Aldi Thanks For Google and Stackoverflow.

Contoh Query SELECT dan UPDATE ALL Dari Table Lain

27 sec read

informasi min

Berikut Contoh Query :

UPDATE MASTERKARYAWAN MK SET MK.JABATAN = (SELECT A.JABATANREVISI from TABELTDM A
where A.JABATAN = MK.JABATAN ) WHERE MK.JABATAN IN (SELECT B.JABATAN FROM TABELTDM B)

UPDATE MASTERKARYAWAN MK SET MK.JABATAN = (SELECT A.JABATANREVISI from TABELTDM A
where A.JABATAN = MK.JABATAN ) WHERE MK.JABATAN NOT IN (SELECT B.JABATAN FROM TABELTDM B)

SELECT S.NOPOLISI, S.TANGGAL, S.TOTALKM, S.DURASI, S.KETERANGAN FROM TEMPGPSHARIAN S
WHERE S.NOPOLISI IN (SELECT T.NOPOLISI FROM TBLGPSHARIAN T)

SELECT S.NOPOLISI, S.TANGGAL, S.TOTALKM, S.DURASI, S.KETERANGAN FROM TEMPGPSHARIAN S
WHERE S.NOPOLISI NOT IN (SELECT T.NOPOLISI FROM TBLGPSHARIAN T)

 

NOTE :
IN : menampilkan data yang ada di dalam tabel tersebut
NOT IN : menampilkan data yang bukan di dalam tabel tesebut

Aldi Thanks For Google and Stackoverflow.

Leave a Reply

Your email address will not be published. Required fields are marked *

×

Thank you for visiting this blog, don’t forget to comment here

 

ALDI
Aldi@index.my.id