If I have a table T with 4 rows & 2 columns A & B. A has
values 1,2,3,4. and B has 10,20,30,40. Write an Update SQL
query which can Swap the values of A & B for all records.
(Do not use a sub-query)

Answer Posted / avi007

select A as "B",B AS "A" from T;

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you remove duplicate records from a table?

507


What are types of exception?

530


Is primary key clustered index?

513


What are the basic techniques of indexing?

563


what are the authentication modes in sql server? How can it be changed? : Sql dba

695






How do I count records in sql?

508


how to get @@error and @@rowcount at the same time? : Sql dba

522


What is trigger explain with example?

542


What is a primary key? Explain

535


What is mutating table error?

651


Why are sql stored procedures used?

611


How can you view the errors encountered in a trigger?

540


what does the t-sql command ident_incr does? : Transact sql

591


GLOBAL TEMPORARY TABLE over Views in advantages insolving mutating error?

2567


What is the difference between union and union all command?

540