there are 2 variables called x and y ,x contains 1,2 and y
contains 3,4 we have to swap the values from x to y and y
to x with out using dummy variables and it can be done only
by using a single statement ? how?

Answer Posted / sheshadri

String x="1,2";
String y="3,4";
x=(y+"$"+(y=x)).split("[$]")[0];

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the purpose of primary key?

749


How to write a single statement that concatenates the words ?hello? And ?world? And assign it in a variable named greeting?

822


how to check server status with 'mysqladmin'? : Sql dba

784


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

3579


How do you update f as m and m as f from the below table testtable?

1465






what is 'mysqlshow'? : Sql dba

748


what is sql profiler? : Sql dba

793


Can we use threading in pl/sql?

712


Define overloaded procedure?

803


What is data control language (dcl)?

790


What is the difference between subquery and correlated query?

724


What is not in sql?

667


How do I view tables in sql developer?

680


What is int identity in sql?

758


What are the two types of exceptions.

818