Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
877 B
1
Indexable
Never
select p.id, p.nama_depan, p.nama_belakang, n.nomor_utama, n.deskripsi,
(select jenis_kendaraan from table_3 as v where v.id = p.id order by v.id limit 1) as jenis_kendaraan_pertama,
(select merk_kendaraan from table_3 as v where v.id = p.id order by v.id limit 1) as merk_keendaraan_pertama,
(select tipe_kendaraan from table_3 as v where v.id = p.id order by v.id limit 1) as tipe_kendaraan_pertama,
(select jenis_kendaraan from table_3 as v where v.id = p.id order by v.id limit 1 offset 1) as jenis_kendaraan_kedua,
(select merk_kendaraan from table_3 as v where v.id = p.id order by v.id limit 1 offset 1) as merk_kendaraan_kedua,
(select tipe_kendaraan from table_3 as v where v.id = p.id order by v.id limit 1 offset 1) as tipe_kedua
from table_1 as p left join table_2 as n using(id)
where exists(select 1 from table_3 as v where v.id = p.id)
order by p.id asc
Leave a Comment