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 memory-optimized nonclustered indexes
What are the different sql server versions?
How to create a large table with random data for index testing in ms sql server?
What are the difference between “where” and “having” clause in sql server?
How you provide security to cube? : sql server analysis services, ssas
What is a full text index?
How does using a separate hard drive for several database objects improves performance right away?
What is difference between inner join and join?
What are the benefits of normalization?
What is difference between rollback immediate and with no_wait during alter database?
Which is faster statement or preparedstatement?
What is difference between aggregate and analytic function?
What is a unique index?
What is SQL Azure Data sync?
Explain what is public role in sql server?