Interview questions [message #637787] |
Mon, 25 May 2015 01:22 |
|
purnima1
Messages: 79 Registered: June 2014
|
Member |
|
|
Hi All,
Please help in providing the query for deleting duplicate rows,from the below mentioned, if it is possible.
in the ouput we can see distance between delhi to mumbai and numbai to delhi is same ,so there is no point of storing two rows for same thing.
Please confirm if possible.
Thanks in advance
create table tab (city1 varchar2(100),city2 varchar2(100),distance number );
begin
insert into tab values ('DELHI','MUMBAI',2000);
insert into tab values ('MUMBAI','DELHII',2000);
insert into tab values ('MUMBAI','PUNE',2000);
insert into tab values ('PUNE','MUMBAI',2000);
commit;
end ;
select * from tab ;
city1 city2 distance
DELHI MUMBAI 2000
MUMBAI DELHII 2000
MUMBAI PUNE 2000
PUNE MUMBAI 2000
[Updated on: Mon, 25 May 2015 01:24] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|