Hi,
i created tabe which is contain only one column. in that column there are positive and negative values. By using query i want to separate positive values and negative values in two different columns. i tried but could not find the solution. pls help
Regards
Ajaypal
Could be something like:
select case then yourfield<0 then yourfield else null end as negative
,case then yourfield>=0 then yourfield else null end as positive
from yourtable
;
Thanks for reply. But the query is not working.
While running above query, then output error says " Incorrect syntax near
the key word 'then' .
I removed 'then' after 'case' word.
Then output giving error as " Incorrect syntax error near '<'."
Pls help me.
Regards
SP.Ajay Pal
My fault. Do this instead:
select case when yourfield<0 then yourfield else null end as negative
,case when yourfield>=0 then yourfield else null end as positive
from yourtable
;