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
Tell me what is sql profiler?
IF more than one Site is accessing the same Database server and I want to move the DB with Minimum down time? How will you do
How do I change my passwords (database, LDAP, and so on) without causing an outage?
How can you set the threshold at which sql server will generate keysets asynchronously?
What does top operator do?
What is the recursive stored procedure in sql server?
A user is a member of the public role and the sales role. The public role has select permission on all the tables. The sales role does not have select permission on some of the tables will the user be able to select from all tables?
How do I find the default sql server instance?
What is the maximum number of index per table?
Explain comment on transactions?
How to use order by with union operators in ms sql server?
How to loop through result set objects using odbc_fetch_row()?
what is the information that can be stored inside a bit column? : Sql server database administration
what are the new features introduced in sql server 2000? : Sql server database administration
What is the difference between char, varchar and nvarchar?