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 / krishna reddy l
update example set column1 = case when column1=0 then 1
when column1=1 then 0 end
| Is This Answer Correct ? | 0 Yes | 3 No |
Post New Answer View All Answers
What is the Difference Between Primary and Foreign Key?
Explain about builtinadministrator?
How to name query output columns in ms sql server?
What is key attribute?
Why the trigger fires multiple times in single login?
List the different types of joins?
What is user-defined functions? What are the types of user-defined functions that can be created?
Explain about Views?
What is the difference between indexing and hashing?
What is change data capture (cdc) in sql server 2008?
What is a transact-sql statement batch in ms sql server?
How to declare and use cursor variables?
What is the use of RDBMS?
You have a table ‘test’ which is a copy of northwind employee table you have written a trigger to update the field ‘hiredate’ with the current date
what is the system function to get the current user's user id? : Sql server database administration