rianto isaac's Weblog

rianto utomo isaac sahala utomo

php – mysql, beda select left join pada mysql dan mssql

leave a comment »

mssql :

SELECT a.*, b.*
FROM cust as a
natural left join data as b
on a.cab = b.cab and a.cust = b.cust
WHERE a.cab = ‘aipp’ and b.thn = 2012 and b.bln = 6

mysql :

SELECT a.*, b.*
FROM cust as a
natural left join data as b
on a.cab = b.cab and a.cust = b.cust and b.thn = 2012 and b.bln = 6
WHERE a.cab = ‘aipp’

mysql di php5
SELECT a.*,
b.nama as Perush, b.kode as KodPerush,
c.nama as Dept, c.kode as KodDept,
d.nama as Jabt, d.kode as KodJabt,
e.keterangan as Grd, e.kode as KodKet
FROM Employee as a
left join (Perusahaan as b) on (a.Perusahaan = b.Id)
left join (Departemen as c) on (a.Departemen = c.Id)
left join (Jabatan as d) on (a.Jabatan = d.Id)
left join (Grade as e) on (a.Grade = e.Id)
where a.NIK = ‘$_SESSION[

 

Written by isaaconi

Juli 26, 2013 pada 12:58 pm

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: