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 / vernold

Update Table1 Set Column = case when Column = 1 then 0
when column = 0 then 1

Is This Answer Correct ?    5 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the new features in sql server 2016?

532


How to recover from sql injection? : sql server security

514


You have developed an application which uses many stored procedures and triggers to update various tables users ocassionally get locking problems which tool is best suited to help you diagnose the problem?

562


What is a view in sql?

570


How do I run sql server 2014?

503






Explain about unique identifier data type in sql server?

501


What is global temp table?

548


Do you know what is xpath?

550


If you lose rights to your sql server instance what are the options to connect to sql server instance? : sql server security

528


Do I need a report server to run reports in my application?

104


What is "scheduled jobs" or "scheduled tasks"?

548


1. Tell me your daily activities 2. If sql server installation fails at time installation what will do 3. Where does the sql server installation log details are stored 4. After the installation what will you do for memory configuration 5. What is the difference between SQL max maximum memory and AWE memory 6. How will you configure AWE memory 7. How will setup an email alert for the backup job 8. After the SQL installation what are the jobs will you configure 9. What does –g mean in the sql startup parameter 10. What is the difference between Bulked log and Full recovery model 11. What is the difference between mirroring and log shipping 12. What are the steps to be followed before in-place up gradation 13. After installing the patch the sql server does not start and application team tells to rollback the changes .In this scenario what will you do

2055


What is sql server locking?

543


explain different types of joins? : Sql server database administration

523


How many database files are there in sql server 2000?what are they?

572