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)
 Data selection - SQL Query

Author  Topic 

kakikupart
Starting Member

11 Posts

Posted - 2009-09-27 : 22:37:06
Pls anyone help me ...

Let say I got one field in the table that contains positif and negative value.How to write query statement for separate both - and + value

Your help apprieciated.
Dwen

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2009-09-27 : 23:20:50
separate into 2 column like this ?

select positive_value = case when the_value >= 0 then the_value end
negative_value = case when the_value < 0 then the_value end
from the_table



KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -