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 |
what is rdbms? : Sql dba
Can sql function call stored procedure?
I want to know last five transactions or records from emp table, from now?
How do I start pl sql?
what is purge command explain about oracle performance tuning
2 Answers Accenture, eCentric Solutions,
What is the first action to perform a query? Suppose I have four tables and five joins and my query is getting slow day by day.
Does truncate table reset auto increment?
select * from emp where sal in(select max(sal) from emp) here there is any limit for in operator how many values accpect ?
What is sql rowcount?
Can we use commit or rollback in trigger? If yes, then how. Please explain with a suitable example?
what are date and time functions in mysql? : Sql dba
How is pl sql different from sql?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)