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
How will you optimize a stored procedure optimization?
What are constraints?
What are Row versions of DataRow?
What are the advantages of user-defined functions over stored procedures in sql server?
What is row_number()?
How do clustered indexes store data?
What is dirty page?
What is checkpoint process in the sql server?
What is the data tier application?
How to check if a table is being used in sql server?
While you are inserting values into a table with the insert into .. Values option, does the order of the columns in the insert statement have to be the same as the order of the columns in the table?
What do you mean by tablesample?
How to stop log file growing too big?
What is the difference RDBMS and Graph Database?
What is the default value of an integer data type in sql server 2005?