Solved

Need to do a selective join

Posted on 2010-08-27
2
361 Views
Last Modified: 2012-06-22
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
Comment
Question by:John_Merrick
2 Comments
 
LVL 22

Accepted Solution

by:
pivar earned 500 total points
ID: 33540969
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
 
LVL 1

Author Comment

by:John_Merrick
ID: 33541000
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Viewers will learn how the fundamental information of how to create a table.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now