Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

How can i loop through record set BY sql

$
0
0

I have  record set which is result of select * from table ... 

1   A   0

2   B    1

3   C    1

I want to loop through all row and check  last column of each row.  I dont know how to do this in SQL for example 

For  each row 

if lastcolumn = 1 then

...do somthing...

else

...do somthing...

End if

Next

How can i do this operation in SQL? THANKS


Viewing all articles
Browse latest Browse all 23857

Trending Articles



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