forked from ragil/Json-FHIR
Update Mastering Reference SQL & Json
This commit is contained in:
25
FHIR/SQL/Mastering Reference/Ad Address.sql
Normal file
25
FHIR/SQL/Mastering Reference/Ad Address.sql
Normal file
@@ -0,0 +1,25 @@
|
||||
//----Address 1 - State - Provinsi
|
||||
select
|
||||
mp.idprovinsi as id_idprovinsi, mp.namaprovinsi as nm_namaprovinsi
|
||||
from m_provinsi mp;
|
||||
|
||||
//----Address 2 - City - Kota
|
||||
select
|
||||
mk.idkota as id_idkota, mk.namakota as nm_namakota,
|
||||
mp.idprovinsi as ref_idprovinsi , mp.namaprovinsi as ref_namaprovinsi
|
||||
from m_kota mk
|
||||
join m_provinsi mp on mp.idprovinsi = mk.idprovinsi;
|
||||
|
||||
//----Address 3 - Distric - Kecamatan
|
||||
select
|
||||
mc.idkecamatan as id_idkecamatan, mc.namakecamatan as nm_namakecamatan,
|
||||
mk.idkota as ref_idkota, mk.namakota as ref_namakota
|
||||
from m_kecamatan mc
|
||||
join m_kota mk on mk.idkota = mc.idkota;
|
||||
|
||||
//----Address 4 - Village - Kelurahan
|
||||
select
|
||||
ml.idkelurahan as id_idkelurahan, ml.namakelurahan as nm_namakelurahan,
|
||||
mc.idkecamatan as id_idkecamatan, mc.namakecamatan as nm_namakecamatan
|
||||
from m_kelurahan ml
|
||||
join m_kecamatan mc on mc.idkecamatan = ml.idkecamatan;
|
||||
Reference in New Issue
Block a user