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
 How to form this query

Author  Topic 

ceema
Yak Posting Veteran

80 Posts

Posted - 2007-01-17 : 01:39:10
I have a table SIM_TempCustomer where I have 5 fileds nad Values Like


SIM_TempCustomer
----------------

Val1.........Val2.........Val3.........Val4.........Val5
---------------------------------------------------------
A.............NUll........1.............Null.........3
B.............Null........Null..........Null.........2
C.............Null........6.............12...........Null


What I want i, if there is any value in any fields, other null values
in the field should be replaced by 0, if all the rows of the filed
are null, simply leave as it is....


Like the select statement of this SIM_TempCustomer should give a result like


Val1.........Val2.........Val3.........Val4.........Val5
---------------------------------------------------------
A.............NUll........1.............0............3
B.............Null........0.............0............2
C.............Null........6.............12...........0


Could any one help me.

Thanks
Ceema

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-01-17 : 02:37:24
Duplicate post!
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=77678 (answered)


Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -