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 are the disadvantages of indexes?
How to remove duplicate rows from table except one?
What happens if ntwdblib.dll is missing on your machine?
What is the difference between migration and upgradation in sql server?
How you can add messages to the nt event log from within a stored procedure?
How to achieve Paging of records in SQL SERVER?
Does view occupy space?
What is user defined stored procedures?
which table keeps the locking information? : Sql server administration
How to change the system date and time from SQL Plus Terminal ?
Difference between Inner vs outer joins?
What is the default sql server instance name?
Can you name some of the dml commands in sql?
How to provide default values to stored procedure parameters?
What is faster join or union?