SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Another Join
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Zath
Constraint Violating Yak Guru

USA
282 Posts

Posted - 11/01/2010 :  17:11:02  Show Profile  Visit Zath's Homepage  Reply with Quote

I'm stuck on this one.

I have a table, let's call it TableOne
I want everything from that table.
Primary key is a number.
Name is a varchar

There is a Partner table, call it TablePartner
Primary key is a number.
PartnerName is a varchar

I have a reference table. Let's call it TableRef
Primary key is a number
Col 1 is an int that references TablePartner PK
Col 2 is an int that references TableOne PK

Again, I want everything from TableOne and need to have something back from TableRef to tell me that Name from TableOne is active, that is it exists in TableRef.

The TablePartner just brings back the PartnerName
Having trouble with the Ref table.

Any suggestions?

Thanks,

Zath

Zath
Constraint Violating Yak Guru

USA
282 Posts

Posted - 11/01/2010 :  18:31:16  Show Profile  Visit Zath's Homepage  Reply with Quote
Got it working!

Had to use a CASE and WHEN EXISTS...
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000