Comments (6)
untuk data dan aplikasi terbaru silakan mengacu ke https://github.com/cahyadsn/wilayah
from daerah.
sudah saya tambahkan query untuk konversi data dari db wilayah_2020 ke db daerah
from daerah.
dari REPLACE(kode,'.') menjadi REPLACE(kode,',','') ... kurang satu parameter
from daerah.
udah saya cek ke link tersebut tetapi tidak ada sql yang berelasi untuk table kelurahan -> kecamatan -> kota -> provinsi seperti pada db_daerah.sql di versi sebelumnya
from daerah.
maaf mas masih ada error saat menginputkan datanya
-- TRUNCATE TABLE kabupaten;
INSERT INTO kabupaten (id_kab, id_prov, nama, id_jenis)
SELECT
REPLACE(kode,'.') AS id_kab,
LEFT(kode,2) AS id_prov,
nama,
IF(SUBSTR(kode,4,1)='7',2,1) AS id_jenis
FROM wilayah_2020
WHERE LENGTH(kode)=5
ORDER BY kode
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') AS id_kab,
LEFT(kode,2) AS id_prov,
nama,
IF(SUBSTR(kode,4,1' at line 3
-- TRUNCATE TABLE kecamatan;
INSERT INTO kecamatan (id_kec, id_kab, nama)
SELECT
REPLACE(kode,'.') AS id_kec,
REPLACE(LEFT(kode,5),'.') AS id_kab,
nama
FROM wilayah_2020
WHERE LENGTH(kode)=8
ORDER BY kode
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') AS id_kec,
REPLACE(LEFT(kode,5),'.') AS id_kab,
nama
FROM wilayah' at line 3
-- TRUNCATE TABLE kelurahan;
INSERT INTO kelurahan (id_kel, id_kec, nama, id_jenis)
SELECT
REPLACE(kode,'.') AS id_kel,
LEFT(kode,8) AS id_kec,
nama,
IF(SUBSTR(kode,10,1)='2',3,4) AS id_jenis
FROM wilayah_2020
WHERE LENGTH(kode)=13
ORDER BY kode
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') AS id_kel,
LEFT(kode,8) AS id_kec,
nama,
IF(SUBSTR(kode,10,1' at line 3
from daerah.
well done mas cahya, sudah tidak ada error, thanks so much!
from daerah.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from daerah.