Created
December 30, 2014 19:02
-
-
Save zazk/de2133faa204d5bb4ffb to your computer and use it in GitHub Desktop.
Concatenate ID Oracle 10g
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT SUBSTR (SYS_CONNECT_BY_PATH (id_reporte , ','), 2) csv | |
| FROM (SELECT id_reporte , ROW_NUMBER () OVER (ORDER BY id_reporte ) rn, | |
| COUNT (*) OVER () cnt | |
| FROM geo_reporte_servicios WHERE ANO='2014' AND COD_CA='CEM001' AND UBIGEO='030101' AND COD_SERV='SER001') | |
| WHERE rn = cnt | |
| START WITH rn = 1 | |
| CONNECT BY rn = PRIOR rn + 1 | |
| --RESULT | |
| -- 2163,2165,2167,2169,2171,2173,2175,2177,2179,2181,2183,2185 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment