Skip to content

Instantly share code, notes, and snippets.

@snahor
Created Dec 22, 2010
Embed
What would you like to do?
SELECT
(SELECT name
FROM ubigeo u0
WHERE u0.province_code = ubigeo.province_code
AND u0.department_code = ubigeo.department_code LIMIT 1) AS "provincia",
(SELECT name
FROM ubigeo u0
WHERE u0.department_code = ubigeo.department_code LIMIT 1) AS "departamento",
"ubigeo"."id", "ubigeo"."department_code", "ubigeo"."province_code", "ubigeo"."district_code", "ubigeo"."name" FROM "ubigeo" WHERE "ubigeo"."id" = 758
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment