Hi Ranganath,
the query for ur first question is
update testtab t1 set t1.code = ( select t2.type from testtab t2
where t1.rowid = t2.rowid ) , t1.type= ( select t2.code from
testtab t2 where t1.rowid = t2.rowid )
...will let u know if i can get a query for ur second question.
Regards,
Prem
Message-
From: Krishnaswamy, Ranganath
Sent: Thursday, January 30, 2003 10:39 AM
To: Multiple recipients of list ORACLE-L
Subject: Queries Help
Hi List,
I need the queries for the following requirements. Can anybody help me
please?
1. A table has two columns Code and Type
Simpler
SQL select * from testab;
CODE TYPE
-- --
5 1
6 2
SQL UPDATE testab SET code = type, type = code;
2 rows updated.
SQL select * from testab;
CODE TYPE
-- --
1 5
2
Solution to second query:
SQL SELECT * FROM emp;
EMPID MGRID SALARY NAME
-- -- -- --
1 1000 A
2 1500 B
3 1 1500 C
SQL SELECT *
2 FROM emp e1
3 WHERE mgrid IS NOT NULL
Hi List,
I need the queries for the following requirements. Can anybody help me
please?
1. A table has two columns Code and Type. Form a query to swap the
values of these columns.
2. A table contains empid, salary, mgr_id. Form a query to select the
employees who have the salary more than