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 2000 Forums
 Transact-SQL (2000)
 Using Case When

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-07-15 : 07:49:12
Alaa writes "Select a,b
//what i want to make
if(a>b)then
c=a\\new field
else
c=b
From mytable

Plz help"

AndyB13
Aged Yak Warrior

583 Posts

Posted - 2005-07-15 : 08:06:44
Try

SELECT CASE WHEN a > b THEN a ELSE b END AS C

Andy

Beauty is in the eyes of the beerholder
Go to Top of Page
   

- Advertisement -