Home » SQL & PL/SQL » SQL & PL/SQL » Avoding duplicate records - URGENT
Avoding duplicate records - URGENT [message #23487] Thu, 12 December 2002 10:42 Go to next message
Raj
Messages: 411
Registered: November 1998
Senior Member
Hi!

Query:

select a.f1, a.f2, a.f3, b.f1,b.f2, c.f1
from tableA a, tableB b, tableC c
where a.f4 = b.f4 and
a.f1 = c.f2(+) and
a.f1 in (12345);

This returns the following result:

f1 f2 f3
----- ------ ------
12345 follow US
12345 follow US

table C has the record 12345

I have to join table A with Table C at the same time
I do not want to include the record 12345 from table C
in my result, basically I should retrieve only one record. Could someone help me how to do it?

can this be achieved with left join or right join.

Thanks
- Raj
Re: Avoding duplicate records - URGENT [message #23488 is a reply to message #23487] Thu, 12 December 2002 10:48 Go to previous message
casanova
Messages: 4
Registered: December 2002
Junior Member
select DISTINCT a.f1, a.f2, a.f3, b.f1,b.f2, c.f1
from tableA a, tableB b, tableC c
where a.f4 = b.f4 and
a.f1 = c.f2(+) and
a.f1 in (12345);
Previous Topic: Transfer Data
Next Topic: sql problem
Goto Forum:
  


Current Time: Tue May 14 20:20:44 CDT 2024