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 / madhu sudhan g
Hiii Lets take a table Test contains one field No having 8
rows in that 4 rows are with 0's and 4 rows with 1's to update
Update Test
SET No=case when 1 then o
else 1
ENd
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is query optimizer in sql server?
What is sharding?
what kind of lan types do you know? : Sql server database administration
What is a view and what are its advantages?
Why should we go for stored procedures? Why not direct queries?
What do you mean by acid?
How to use values from other tables in update statements in ms sql server?
Does the unique constraint create an index?
What are the different index configurations a table can have?
How to select some specific columns from a table in a query in ms sql server?
How to test values returned by a subquery with the in operator?
What is the sql server 2000 version number?
Can you give me some DBCC command options?(Database consistency check) - DBCC CHECKDB - Ensures that tables in the db and the indexes are correctly linked.and DBCC CHECKALLOC - To check that all pages in a db are correctly allocated. DBCC SQLPERF - It gives report on current usage of transaction log in percentage. DBCC CHECKFILEGROUP - Checks all tables file group for any damage.
What are the instances when triggers are appropriate?
Which is the main third-party tool used in sql server?