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


Please Help Members By Posting Answers For Below Questions

what is memory-optimized nonclustered indexes

565


What are the different sql server versions?

525


How to create a large table with random data for index testing in ms sql server?

544


What are the difference between “where” and “having” clause in sql server?

592


How you provide security to cube? : sql server analysis services, ssas

543






What is a full text index?

499


How does using a separate hard drive for several database objects improves performance right away?

536


What is difference between inner join and join?

542


What are the benefits of normalization?

579


What is difference between rollback immediate and with no_wait during alter database?

583


Which is faster statement or preparedstatement?

543


What is difference between aggregate and analytic function?

487


What is a unique index?

532


What is SQL Azure Data sync?

105


Explain what is public role in sql server?

589