티스토리 뷰

Database

[ORACLE]이메일 도메인 걸러내기

애플자라 2012. 11. 22. 17:36
반응형

SELECT SUBSTR(TO_EMAIL, INSTR(TO_EMAIL,'@')+ 1,LENGTH(RTRIM(TO_EMAIL))) AS DOMAIN,
COUNT(SUBSTR(TO_EMAIL, INSTR(TO_EMAIL,'@')+ 1,LENGTH(RTRIM(TO_EMAIL)))) AS DOMAIN_CNTS
FROM AUTO120
WHERE WORKDAY='20121116'
AND SEQNO=5
GROUP BY SUBSTR(TO_EMAIL, INSTR(TO_EMAIL,'@')+ 1,LENGTH(RTRIM(TO_EMAIL)))
HAVING COUNT(SUBSTR(TO_EMAIL, INSTR(TO_EMAIL,'@')+ 1,LENGTH(RTRIM(TO_EMAIL)))) > 0
ORDER BY COUNT(SUBSTR(TO_EMAIL, INSTR(TO_EMAIL,'@')+ 1,LENGTH(RTRIM(TO_EMAIL)))) DESC

 

SELECT
DOMAIN,
COUNT(DOMAIN) AS DOMAIN_CNTS
FROM EBAD1060
WHERE POST_ID = '2008101400001'
GROUP BY DOMAIN
HAVING COUNT(DOMAIN) > 100
ORDER BY COUNT(DOMAIN) DESC

반응형
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/11   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
글 보관함