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
 General SQL Server Forums
 New to SQL Server Programming
 condition query

Author  Topic 

atuljadhavnetafim
Starting Member

25 Posts

Posted - 2014-09-19 : 04:04:44
Dear Expert

i have one table "AR" in SQL Server, and in that table one column is there named "Arrear"
this column contain positive and negative numner like
123, 43, 54, 0, -34, -56, -678
now i want to bifurcate this number in category like
if the bumber >=0 then category will be "OD"
if the number <0 then category will be "FD"
i have one blank extra column in my data base, or we can create new column with above condition

but how

please help me

Atul Jadhav

Arun Babu N
Starting Member

26 Posts

Posted - 2014-09-19 : 04:07:06
use case .

case when Arrear >=0 then 'OD'
else 'FD' end 'NewColumn'

arunbabu
Go to Top of Page

Upendra Gupta
Starting Member

12 Posts

Posted - 2014-09-19 : 06:16:35
unspammed
Go to Top of Page
   

- Advertisement -