i have two tables namely PESANMASUK anda KONTAK. in PESANMASUK i have 5 fileds : IDMASUK, TANGGALMASUK, JAM, NOMERHP, ISIPESAN . and KONTAK i have 3 fileds : IDKONTAK, NAMA, NOHP.
PESANMASUK table :
IDMASUK TANGGALMASUK JAM NOMERHP ISIPESAN
1 09/08/2015 09:00 +62847776 try sms
2 08/08/2015 10:00 +62856790 plase come in
3 08/08/2015 06:00 +6283444 you and me
KONTAK table :
IDKONTAK NAMA NOHP
1 RIAN +62847776
2 ALFIAN +62856790
and this result is i want :
IDMASUK TANGGALMASUK JAM NOMERHP NAMA ISIPESAN
1 09/08/2015 09:00 +62847776 RIAN try sms
2 08/08/2015 10:00 +62856790 ALFIAN plase come in
3 08/08/2015 06:00 +6283444 you and me
this is my oracle query :
SELECT IDMASUK, TANGGALMASUK, JAM, NOMERHP, ISIPESAN,
(SELECT NAMA FROM KONTAK WHERE NOHP IN (SELECT NOMERHP FROM PESANMASUK)) AS NAMA
FROM PESANMASUK
I got error like this :
ORA-01427: single-row subquery returns more than one row
I wanna matching between NOMERHP in PESANMASUK and NAMA in KONTAK and return all rows.
how can I solve this??