WITH TT(A) AS ( SELECT '2014' FROM DUAL UNION ALL SELECT '' FROM DUAL UNION ALL SELECT '2008,2009,2010,2011,2012,2013' FROM DUAL UNION ALL SELECT '2005,2006,2007,2008,2009,2010,2011,2012,2013' FROM DUAL ) SELECT REGEXP_COUNT(A,',')+1 COUNT1 , REGEXP_COUNT(A,'20') COUNT2 , CEIL(LENGTH(A)/5) COUNT3 , ROUND(LENGTH(A)/5) COUNT4 , LENGTH(REPLACE(A,','))/4 COUNT5 , SUBSTR(A,-4,4) - SUBSTR(A,1,4) + 1 COUNT6 FROM TT ;