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 / vernold

Update Table1 Set Column = case when Column = 1 then 0
when column = 0 then 1

Is This Answer Correct ?    5 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is it true that rules do not apply to data already existing in a database at the time the rule is created?

567


What is a rownum?

507


Mention a few common trace flags used with sql server?

546


Why I am getting this error when dropping a database in ms sql server?

598


Explain Reporting Life Cycle?

90






As per your opinion what are the five top responsibilities of a dba? : sql server database administration

618


What is statement level trigger?

547


Where is trigger in sql server?

547


Does an index slow down updates on indexed columns?

582


Equi join and non equi join is possible with sql server?

489


when would you go for denormalization? : Sql server database administration

489


What are the different types of join?

577


What are .mdf files?

526


Explain use of expression builder.

571


Explain the different types of joins?

574