SELECT
COUNT(DECODE(TO_CHAR(TO_DATE('Start Date','DD/MM/YYYY')+LEVEL-1,'D'),7,NULL,1,NULL,1)) FROM DUAL
CONNECT BY LEVEL <= TO_DATE('End Date','DD/MM/YYYY') -TO_DATE('Start Date','DD/MM/YYYY')+1;
Thursday, June 24, 2010
Thursday, June 17, 2010
Wednesday, June 9, 2010
Translate Function
SELECT TRANSLATE('bernandas', 'abcdefghijklmnopqrstuvxyz', '0123456789qwertyuiop[kjhbv')
FROM DUAL;
Output
------
14ir0r30o
SELECT TRANSLATE('14ir0r30o', '0123456789qwertyuiop[kjhbv', 'abcdefghijklmnopqrstuvxyz')
FROM DUAL;
Output
------
bernandas
FROM DUAL;
Output
------
14ir0r30o
SELECT TRANSLATE('14ir0r30o', '0123456789qwertyuiop[kjhbv', 'abcdefghijklmnopqrstuvxyz')
FROM DUAL;
Output
------
bernandas
Occurance of a Letter in a String
SELECT LENGTH('BERNADNAS')-NVL(LENGTH(REPLACE('BERNADNAS','A')),0)
FROM DUAL
FROM DUAL
Subscribe to:
Posts (Atom)