Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[sql] ghep bang - UNION ALL #sql #UNION #ghep_bang
SELECT hientrang_cong.name,
replace(replace(replace((''::text || box2d(st_transform(hientrang_cong.geom, 4326))), 'BOX('::text, ''::text), ')'::text, ''::text), ' '::text, ','::text) AS bbox
FROM hientrang_cong
UNION ALL
SELECT hientrang_dap.name,
replace(replace(replace((''::text || box2d(st_transform(hientrang_dap.geom, 4326))), 'BOX('::text, ''::text), ')'::text, ''::text), ' '::text, ','::text) AS bbox
FROM hientrang_dap
UNION ALL
SELECT hientrang_debao.name,
replace(replace(replace((''::text || box2d(st_transform(hientrang_debao.geom, 4326))), 'BOX('::text, ''::text), ')'::text, ''::text), ' '::text, ','::text) AS bbox
FROM hientrang_debao
UNION ALL
SELECT quyhoach_cong_authuyen.name,
replace(replace(replace((''::text || box2d(st_transform(quyhoach_cong_authuyen.geom, 4326))), 'BOX('::text, ''::text), ')'::text, ''::text), ' '::text, ','::text) AS bbox
FROM quyhoach_cong_authuyen
UNION ALL
SELECT quyhoach_debao.name,
replace(replace(replace((''::text || box2d(st_transform(quyhoach_debao.geom, 4326))), 'BOX('::text, ''::text), ')'::text, ''::text), ' '::text, ','::text) AS bbox
FROM quyhoach_debao
UNION ALL
SELECT quyhoach_trambom.name,
replace(replace(replace((''::text || box2d(st_transform(quyhoach_trambom.geom, 4326))), 'BOX('::text, ''::text), ')'::text, ''::text), ' '::text, ','::text) AS bbox
FROM quyhoach_trambom;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment