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 / shaheem ck
UPDATE <tablename>
SET <columnname> = DECODE(<columnname>,0,1,
1,0,
<columnname>);
| Is This Answer Correct ? | 4 Yes | 3 No |
Post New Answer View All Answers
What is logon trigger?
What are the differences between INNER JOIN, LEFT JOIN and RIGHT JOIN in SQL Server?
Explain how many types of relationship?
What extended events?
What is data file in computer?
when would you go for denormalization? : Sql server database administration
When setting replication, is it possible to have a publisher as 64 bit sql server and distributor or subscribers as a 32 bit sql server?
Can we call stored procedure in trigger?
How to insert data into an existing table?
What is a rownum?
What is a Join and explain its types?
Explain the properties of sub-query in sql server?
What are the differences between triggers and stored procedures?
What is a primary key?
How does stuff differ from the replace function?