一种使用connect by level转集合的SQL 语句。
2010-12-24 14:12 Tracy. 阅读(690) 评论(0) 编辑 收藏 举报/* Formatted on 12/24/2010 2:02:41 PM (QP5 v5.163.1008.3004) */
SELECT TO_CHAR (SUBSTR (c,
INSTR (c,
',',
1,
LEVEL)
+ 1,
INSTR (c,
',',
1,
LEVEL + 1)
- INSTR (c,
',',
1,
LEVEL)
- 1)) dayofweek
FROM (SELECT ',' || 'MON,TUE,WED' || ',' c FROM DUAL)
CONNECT BY LEVEL < LENGTH (c) - LENGTH (REPLACE (c, ','))
本文来自博客园,作者:Tracy.,转载请注明原文链接:https://www.cnblogs.com/tracy/archive/2010/12/24/1915958.html