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
Can I use sql azure as a backup with log shipping or database mirroring?
Where sql server user names and passwords are stored in sql server? : sql server database administration
What do you understand by a view? What does the with check option clause for a view do?
What are user-defined functions (udfs) in sql server?
Can you type more than one query in the query editor screen at the same time?
what is the system function to get current user's user id? : Sql server database administration
While migrating Microsoft SQL Server 2008 database to SQL Azure, what can be done to ensure the database connectivity does not degrade?
What are the different types of sub-queries?
What is the difference between the export /import functions in sql studio and standalone sql manager? : sql server management studio
Explain what is public role in sql server?
What samples and sample databases are provided by microsoft?
What is ssrs?
what is a schema in sql server 2005? Explain how to create a new schema in a database? : Sql server database administration
What is cursors?
What is GUID in sql server?