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
Differentiate between truncate vs delete in mssql?
Difference between primary key and clustered index?
How to truncate the log in sql server 2012? : sql server database administration
How to view existing indexes on an given table using sp_help?
Can you change the data type of a column in a table after the table has been created? If so, which command would you use?
Do you know the policy based administration feature of sql server 2008?
When does the auto update index statistics feature in sql server turn itself on?q) what specific conditions database should meet, before you can bulk copy data into it using bcp?
Are all views updatable ?
How do I know if localdb is running?
What is CTE in SQL
What are the different types of stored procedures?
What are the properties of primary key?
Define Unique Key?
What is database isolation in sql server? : sql server database administration
Difference Between ORDER BY Clause and GROUP BY Clause in SQL?