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 - 2007-03-13 : 12:55:07
|
Been trying to get this one but need a little input.SELECT a.Id,g.LabName......FROM someTbl a,table gWHERE a.id = @idAND (b.calLab = g.ID OR g.LabName = ???)With the above, if b.calLab = 0 then there is no entry in table g.(I didn't develop the table or would have included NONE)So, how to tell g.LabName to come back as 'None' if b.calLab = 0?Thanks,Zath |
|
Zath
Constraint Violating Yak Guru
298 Posts |
Posted - 2007-03-13 : 14:23:43
|
Ok, got it.Added a case statement in the select portion then a distinctand it all worked.Zath |
 |
|
|
|
|