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
what are different types of backups available in sql server? Given a particular scenario, how would you go about choosing a backup plan? : Sql server database administration
What are the basic features of a trigger in ms sql server?
What is a db view?
How to set database to be read_only in ms sql server?
What is the difference between truncate and delete commands?
Explain the creation and execution of a user-defined function in the sql server?
Can you please differentiate between a primary key and a unique key?
What is index fragmentation in ms sql server?
How to rename an existing table with the "sp_rename" stored procedure in ms sql server?
Define master database?
How to create an index on an existing table in ms sql server?
Is the order of columns in the set clause important in ms sql server?
What is the difference between function and stored procedure in sql server?
Where actually sql azure database is hosted?
What is data set in report?