Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Zath
Constraint Violating Yak Guru
298 Posts |
Posted - 2010-11-01 : 17:11:02
|
I'm stuck on this one.I have a table, let's call it TableOneI want everything from that table.Primary key is a number.Name is a varcharThere is a Partner table, call it TablePartnerPrimary key is a number.PartnerName is a varcharI have a reference table. Let's call it TableRefPrimary key is a numberCol 1 is an int that references TablePartner PKCol 2 is an int that references TableOne PKAgain, 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 PartnerNameHaving trouble with the Ref table.Any suggestions?Thanks,Zath |
|
Zath
Constraint Violating Yak Guru
298 Posts |
Posted - 2010-11-01 : 18:31:16
|
Got it working!Had to use a CASE and WHEN EXISTS... |
|
|
|
|
|