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 / madhu sudhan g
Hiii Lets take a table Test contains one field No having 8
rows in that 4 rows are with 0's and 4 rows with 1's to update
Update Test
SET No=case when 1 then o
else 1
ENd
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is resource governor?
what is a sub-report?
what types of replication are supported in sql server? : Sql server database administration
Explain what is scheduled job and how to create it?
What are the basic functions for master, msdb, model, tempdb and resource databases? : SQL Server Architecture
What does dml stand for?
What happens to a trigger with multiple affected rows?
What is the significance of null value and why should we avoid permitting null values?
How do you rebuild an identity column?
Explain can you implement data mining in ssrs?
What are the underflow and overflow behaviors on float literals?
Can primary key be a foreign key?
How to use wildcard characters in like operations in ms sql server?
Can you explain about buffer cash and log cache in sql server?
How do I create an extended event in sql server?