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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Join table help

Author  Topic 

hzx
Starting Member

3 Posts

Posted - 2007-08-29 : 11:57:00
Can I use IF ELSE on join table statement? Going to be like this

select * from PACKING p left outer join REJECT r on (IF p.F_QUALITY IS NULL p.REJECT_ID ELSE p.F_REJECT_ID)=r.REJECT_ID

I try to use it to query DB, no luck.

Thanks in advance

mwjdavidson
Aged Yak Warrior

735 Posts

Posted - 2007-08-29 : 11:58:28
Have a look at CASE statements in T-SQL.
Go to Top of Page
   

- Advertisement -