Consider a table with 8 rows 4 rows contains value 0 and 4
rows contains value 1.Now write a single update query to make
all 0's as 1 and all 1's as 0

Answer Posted / vicky

Update test01 Set num =(case num when 1 then 0 when 0
then 1 else 3 end)

Is This Answer Correct ?    10 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why transaction is important?

557


What is linked report?

87


How to make a column nullable?

590


What is the difference between clustered and non-clustered indexes in ms sql server?

481


what method you can use to reduce the overhead of Reporting Services data sources?

147






Can truncate be rolled back?

531


What is service broker?

577


What are sql server functions?

503


What is difference between stored procedure and user defined function?

543


What is an indexing strategy?

527


What is abstracting periodical?

519


What does select 1 mean?

521


How efficient you are in oracle and SQL server?

630


Tell me what is difference between view and materialized view?

515


How to display a past time in days, hours and minutes?

564