Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

how to update else part

$
0
0

Hi all,

i have 2 column data like
col1

1234
null
null
231
null
1111

i want to update this column like
when col1 is null then 1
else col1 =col1 data.

i have written 
UPDATE table1
  set col1=
case when col1 is null then 1 else ( select col1=a.col1 from [table1] a)
end
from [table1].

i else part is wrorng.But how to solve it.

pls suggest


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>