Reputation: 21
I have 2 tables
Table 1
tblpaket : jenis
Table 2
produk : kd_jenis, nm_jenis
How to display all data in tblpaket
and one field in nm_jenis
with tblpaket.jenis
same as kd_jenis
Because I have many fields I am only displaying 3 fields. So I want to display the nm_produk
field from the tblpaket
table where the jenis
record in the tblpaket
table is the same as the kd_type
in table product record. With
select * from tblpaket
because I want display all field in tblpaket
and one field nm_produk
in table produk
where table jenis
field same as table tblproduk
field kd_jenis
Upvotes: 0
Views: 73
Reputation: 50077
Apparently you need to join TBLPAKET
to PRODUK
. You've asked for different things, so I'm not sure I understand your requirements exactly, but based on your last comment it appears you want to do something like
SELECT t.*, p.NM_PRODUK
FROM TBLPAKET t
INNER JOIN PRODUK p
ON p.KD_JENIS = t.JENIS
If this isn't quite what you had in mind, feel free to adjust it as needed.
Best of luck.
Upvotes: 1