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 / krishna reddy l
update example set column1 = case when column1=0 then 1
when column1=1 then 0 end
| Is This Answer Correct ? | 0 Yes | 3 No |
Post New Answer View All Answers
Which data types generate inaccurate results if used with an = or <> comparison in a where clause of a sql statement?
What do you understand by the data quality services in sql server?
what is the difference between count(*) and count(1) ?
Can we hide the definition of a stored procedure from a use?
What is set nocount on?
What is difference between rollback immediate and with no_wait during alter database?
What is wide table?
What is the purpose of optimization?
List out the differences between global and local temp tables in sql server?
How to create a login account in ms sql server to access the database engine using "create login" statements?
Does the unique constraint create an index?
Your sql server is running out of disk space. You notice that there are several large files with ldf extensions what are these files?
What is sqlservr.exe - process - sql server (sqlex?press)?
What is a sql join?
What are the requirements on sql server network connections?