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)
 Using case by two conditions

Author  Topic 

lovehui
Yak Posting Veteran

60 Posts

Posted - 2009-06-17 : 11:39:13
Hi,

I have two tables to be joined.

I want to use case to define something.

case when table1.column1 =1 and table2.column2 =2 then ..
when table1.column1 =2 and table2.column2= 3 then

What is the sql like?

Thanks

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-06-17 : 12:13:46
the posted case statement looks fine. you just need a end


case when table1.column1 =1 and table2.column2 =2 then ..
when table1.column1 =2 and table2.column2= 3 then
...
end
Go to Top of Page
   

- Advertisement -