법인등록번호,사업자,주민등록번호 유효성체크
-- 법인번호 체크 SELECT DECODE(G7, 10 - MOD(G1 + G2 + G3 + G4 + G5 + G6 + G11 + G12 + G13 + G14 + G15 + G16,10), '정상', '비정상') FROM ( SELECT SUBSTR(TTA103_INC_NO,1,1) * 1 AS G1 ,SUBSTR(TTA103_INC_NO,2,1) * 2 AS G2 ,SUBSTR(TTA103_INC_NO,3,1) * 1 AS G3 ,SUBSTR(TTA103_INC_NO,4,1) * 2 AS G4 ,SUBSTR(TTA103_INC_NO,5,1) * 1 AS G5 ,SUBSTR(TTA103_INC_NO,6,1) * 2 AS G6 ,SUBSTR(TTA103_INC_NO,7,1) * 1 AS G11 ,SUBS..
SQL 세로를 가로로 만들기 참조...
1) 세로를 가로의 데이터로 만들기 /* Formatted on 2010/10/07 14:11 (Formatter Plus v4.8.8) */WITH tmp AS (SELECT '1' AS col1, 'A' AS col2 FROM DUAL UNION ALL SELECT '2' AS col1, '가' AS col2 FROM DUAL UNION ALL SELECT '1' AS col1, 'B' AS col2 FROM DUAL UNION ALL SELECT '1' AS col1, 'C' AS col2 FROM DUAL)SELECT col1, LTRIM (SYS_CONNECT_BY_PATH (col2, ','), ',') AS col1 FROM (SELECT col1, col2, ROW_NUMBER () OVE..