Solved

Need to do a selective join

Posted on 2010-08-27
2
376 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

896 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

19 Experts available now in Live!

Get 1:1 Help Now