[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 386
  • Last Modified:

Need to do a selective join

I have created a multi table join and need to join just one more table, please see attachment. I have commented out the table I that is creating the problem. In a nutshell I just want to jjoin each row in the top select with correct row in the bottom table select. But I can't get a unique join, so it's returning two rows becaise band_id and Security_level id have two matches. What I need is to join the top select with the bottom table where band_id and security_level_id (top select) =  band_id and security_level_id (bottom select). I guess this is another level select but just don't know the syntax Screen shot of select and result
0
John_Merrick
Asked:
John_Merrick
1 Solution
 
pivarCommented:
Hi,

Do you mean to do?

join Band_Security_Level f on a.Band_ID = f.Band_ID
AND a.[Security_Level_ID] = f.[Security_Level_ID]

/peter
0
 
John_MerrickAuthor Commented:
Thta's precisely what I'm after I didn't realise I could use AND in a join syntax...
 
Thanks very much
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now