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 / ajay sharma
UPDATE mytable set mycolumn = (mycolumn + 1)%2
| Is This Answer Correct ? | 21 Yes | 4 No |
Post New Answer View All Answers
Is there any difference between primary key and unique with the not null condition?
Your sql server is running out of disk space. You notice that there are several large files with ldf extensions what are these files?
Can we write ddl in trigger?
What is meant by indexing files?
Who developed sql server?
What are commit and rollback in sql?
What is log shipping? Can we do logshipping with SQL Server 7.0 - Logshipping is a new feature of SQL Server 2000. We should have two SQL Server - Enterprise Editions. From Enterprise Manager we can configure the logshipping. In logshipping the transactional log file from one server is automatically updated into the backup database on the other server. If one server fails, the other server will have the same db and we can use this as the DR (disaster recovery) plan.
What changes in the front end code is needed if mirroring is implemented for the high availability? : sql server database administration
What are the types of database schema? : sql server analysis services, ssas
Give me any three differences between Truncate and Delete.
What is transaction server isolation?
Which is better statement or preparedstatement?
What are the advantages to use stored procedures?
What command must you use to include the not null constraint after a table has already been created?
How do I find the transaction log size in sql server?