여백 만들기

2014.11.26 19:30 from database/oracle
/* Formatted on 2014/11/26 오후 7:31:59 (QP5 v5.256.13226.35510) */
WITH M
     AS (SELECT 1 AS seq, 'A' AS val FROM DUAL
         UNION ALL
         SELECT 2 AS seq, 'B' AS val FROM DUAL
         UNION ALL
         SELECT 3 AS seq, 'C' AS val FROM DUAL
         UNION ALL
         SELECT 4 AS seq, 'E' AS val FROM DUAL
         UNION ALL
         SELECT 5 AS seq, 'E' AS val FROM DUAL)
SELECT seq, val FROM M
UNION ALL
    SELECT ROWNUM + (SELECT COUNT (*) FROM M) AS seq,
           DECODE (ROWNUM, 1, '-이하여백-', NULL)
      FROM (SELECT '' val
              FROM DUAL
             WHERE 0 <
                      MOD (
                         (CASE
                             WHEN (SELECT COUNT (*) FROM M) = 0 THEN 29
                             ELSE (SELECT COUNT (*) FROM M)
                          END),
                         30)                           -- 30으로 딱 떨어질때를 위한 제동장치
                            ) S
CONNECT BY LEVEL <=
                30
              - MOD (
                   (CASE
                       WHEN (SELECT COUNT (*) FROM M) = 0 THEN 29
                       ELSE (SELECT COUNT (*) FROM M)
                    END),
                   30)
Posted by 두억시니 트랙백 0 : 댓글 0
SELECT WMSYS.WM_CONCAT (MESSAGE) MESSAGE
  FROM (SELECT LO.MESSAGE MESSAGE
          FROM SMEIS.S_LECTUREOPINION LO
         WHERE     LO.YEAR = '2014'
               AND LO.SEASONCODE = '11'
               AND LO.SUBJECTCODE = '380031'
               AND LO.DIVISION = '12'
               AND MESSAGE IS NOT NULL)
Posted by 두억시니 트랙백 0 : 댓글 0
INSERT INTO S_UPDATELOG
   SELECT *
     FROM (SELECT *
             FROM S_UPDATELOG AS OF TIMESTAMP (SYSTIMESTAMP - INTERVAL '60' MINUTE) A
    WHERE     A.STNO = '2009432007'
          AND A.CHANGECODE = '21'
          AND A.CHANGEYEAR = '2012';
Posted by 두억시니 트랙백 0 : 댓글 0