I have a problem with some SQL query here. I want to select customers are in more than one site Example peter >> site1 peter >> site2 peter site3 please i have tried with many query but i thing is not correct i need something more logical to do that in oracle sql plus.
SQL> select * from HHCCUSTOMERS;
OID O_CNAME CID O_SITE O_BOOKDAT DEPOSIT PAYMENT
1220 tess 120 site3 10-DEC-15 500 1500
1240 hilda 140 site3 30-JAN-16 300 1500
1250 isla 150 site2 04-JAN-16 750 1000
1260 hilda 160 site1 05-FEB-16 800 2000
1280 maija 180 site3 20-NOV-15 650 1500
1290 iris 190 site3 10-DEC-15 600 1500
1200 tess 120 site3 10-DEC-15 500 1500
1202 hilda 140 site2 30-JAN-16 300 1500
1203 louise 130 site1 20-NOV-15 600 1000
9 rows selected. I used this query
select o_cname,oid,o_site,c_type,c_facility
from HHCCUSTOMERS
inner join HHCPARK
on HHCPARK.cid=HHCCUSTOMERS.cid
where o_cname='louise' or o_cname='hilda';
O_CNAME OID O_SITE C_TYPE C_FACILITY
---------- ---------- ------- ---------- ----------
louise 1203 site1 bronze semifurnis
hilda 1240 site3 silver digitalvan
hilda 1202 site3 silver digitalvan
hilda 1260 site1 gold customize