SELECT
Y.YIL, --year
Y.TARIH, --date
T.BASLAMA_TARIHI, --startdate
T.AYRILMA_TARIHI --enddate
FROM PBS_KIDEM_HESABI KB, PBS_TARIHCE T, PBS_PERSONEL P ,
KBB_YILLAR Y --a table with year and date columns
WHERE 1=1
AND KB.PERSONEL_TURU = P.TURU
AND KB.TARIHCE_TURU = T.TURU
AND P.ID = T.ID_PBS_PERSONEL
AND KB.KIDEM_HESABI_ETKISI = 'ARTTIRIR'
AND KB.ID_PBS_KIDEM_HESABI_TURU = 4
---**---
AND (Y.TARIH BETWEEN TRUNC(T.BASLAMA_TARIHI,'YEAR') AND T.AYRILMA_TARIHI)
---**---
AND (P.ID=110947251)
ORDER BY T.BASLAMA_TARIHI,Y.YIL
--end of sql
|
KBB_YILLAR |
|
SQL Resultset |