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 user-defined function? Explain its types i.e. Scalar and inline table value user-defined function?
What are parameterized reports?
Why we use the openxml clause?
What is the difference between resultset and resultsetmetadata?
How to provide column names in insert statements in ms sql server?
How can I check if a view exists in a sql server database?
What is subquery? Explain the properties of a subquery?
Where do we use trace frag?
What are security principals used in sql server 2005?
What is the difference between for auto and for nested?
What is indexed view?
What is oltp (online transaction processing)?
How to get a list all databases on the sql server?
Is mysql the same as sql server?
What is the advantage of sql server?