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?
Answers were Sorted based on User's Feedback
Answer / parivesh sinha
declare
x number:=1;
x1 number:=2;
y number:=3;
y1 number:=4;
begin
x := y1- y;
dbms_output.put_line (x);
x1 := y1+1 - y;
dbms_output.put_line (x1);
y := x +x1;
dbms_output.put_line (y);
y1 := x1+1 +x;
dbms_output.put_line (y1);
end;
Is This Answer Correct ? | 0 Yes | 4 No |
Answer / santhi k
IN ORACLE...
SELECT DECODE(X,X,Y)X,DECODE(Y,Y,X)Y FROM TABLENAME;
Is This Answer Correct ? | 0 Yes | 6 No |
I have a package in which a table was used in a procedure and compiled later i have dropped the table used in the package what would be the status of package specification and body
What is the difference between inner join and outer join?
what are myisam tables? : Sql dba
what is bulk bind
Table Student has 3 columns,Student_id,Student_Name & Course_Id. Table Course has 2 columns, Course_Id & Course_Name.Write a query to listdown all the Courses and number of student in each course.
How can we Get the Updated Rows? ie, There is 100s of Rows i updated the Rows who have salary 5000. then i want to select the Updated Rows. How can we achieve it?
what are the maximum number of rows that can be constructed by inserting rows directly in value list? : Transact sql
What are schema-level triggers?
Why stored procedure is faster than query?
how will you find out the last three records in a table with n no of records and delete them
How can triggers be used for the table auditing?
What is cursor explain with example?