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 / ajay sharma

UPDATE mytable set mycolumn = (mycolumn + 1)%2

Is This Answer Correct ?    21 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Define Joins?

603


List out some of the requirements to set up a sql server failover cluster?

539


What are joins in sql and what are the different types of joins?

545


Explain indexed views?

553


What is parameterized reports in ssrs ?

105






Do you know what is user defined datatypes and when you should go for them?

494


What is difference between rownum and row_number?

507


How will you go about resolving deadlocks?

536


Explain the properties of the relational tables?

546


What is checkpoint in sql server?

607


When columns are added to existing tables, what do they initially contain?

623


what is dbcc? : Sql server database administration

512


How to recompile stored procedure at run time?

562


Do you know what is recursion? Is it possible for a stored procedure to call itself or recursive stored procedure?

535


What is clr ddl trigger?

543