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

What are the different types of joins in sql?

671


how to delete duplicate rows from a join tables(I have three tables on that join) how do you know which join is need to be used? The select statement I have is: SELECT gc_skill_type.skill_type, gc_area_tec.area, gc_technology.technology, gc_technology.id_technology, gc_area_tec.id_area_tec FROM gc_skill_type, gc_area_tec, gc_technology WHERE gc_area_tec.id_skill_type (+) = gc_skill_type.id_skill_type AND gc_technology.id_area_tec (+) = gc_area_tec.id_area_tec order by gc_skill_type.skill_type asc, gc_area_tec.area asc, gc_technology.technology asc

3438


What is cross join example?

649


What is sequence in sql?

613


What is an inconsistent dependency?

676






What will you get by the cursor attribute sql%notfound?

691


What is sql keyword?

660


Why use triggers in sql?

603


How are sql commands classified?

685


What are basic techniques of indexing?

942


what is cursor. write example of it. What are the attributes of cursor.

842


How do I delete a trigger?

631


What are conditional predicates?

695


What is pl sql script?

658


How exception is different from error?

649