Popular Post

Posted by : Murat PINAR 17 Şubat 2015 Salı

SELECT K.NO,
       K.CINS,
       K.TC,
       K.ISIM,
       K.DYER,
       FLOOR(MONTHS_BETWEEN(SYSDATE, K.DOGUMTARIHI) / 12) AS YAS,
       RANK() OVER(PARTITION BY K.DYER, K.CINS ORDER BY FLOOR(MONTHS_BETWEEN(SYSDATE, K.DOGUMTARIHI) / 12)) AS SAY, //ATLAR
       DENSE_RANK() OVER(PARTITION BY K.DYER, K.CINS ORDER BY FLOOR(MONTHS_BETWEEN(SYSDATE, K.DOGUMTARIHI) / 12)) AS SAY2, //KALDIĞI YERDEN
       MIN(FLOOR(MONTHS_BETWEEN(SYSDATE, K.DOGUMTARIHI) / 12)) KEEP(DENSE_RANK FIRST ORDER BY FLOOR(MONTHS_BETWEEN(SYSDATE, K.DOGUMTARIHI) / 12)) OVER(PARTITION BY K.DYER) AS MIN,
       MAX(FN_YAS(K.DOGUMTARIHI)) KEEP(DENSE_RANK LAST ORDER BY FN_YAS(K.DOGUMTARIHI)) OVER(PARTITION BY K.DYER) AS MAX
  FROM KART K
 WHERE K.DYER = 'MERSİN'
--AND ROWNUM<10 comment-10--="">

Copyright © Murat PINAR - Modified By - Designed by