1 2 3 4 5 6 7 8 9
| select C1.cpsidt,'|',cpsidts, '|', cpsidt2, '|', cpsidt4,'|',
(select (substr(idtdcm, 1,15)) from idtdcm I2 where C1.cpsidt = I2.cpsidt and tidcod='geac') GEAC, '|',
(select (substr(idtdcm, 1,15)) from idtdcm I2 where C1.cpsidt = I2.cpsidt and tidcod='clea') CLEA, '|',
(select (substr(idtdcm, 1,15)) from idtdcm I2 where C1.cpsidt = I2.cpsidt and tidcod='cleab') CLEAB, '|',
(select substr(idtdcm, 1,15) from idtdcm I2 where C1.cpsidt = I2.cpsidt and I2.tidcod='sgbidt' and I2.idtdcm like 'b%') SGB,
from CPSNTC C1
where C1.cpsidt in (
482096 )
group by C1.cpsidt, C1.cpsidts, C1.cpsidt2, C1.cpsidt4; |
Partager