WITH nums ( num ) AS ( SELECT ROW_NUMBER() OVER ( ORDER BY ( SELECT NULL ) ) -1 FROM sys.all_columns ) , dlist ( aDay ) AS ( SELECT TOP 500 DATEADD( DAY, num * -1, '2024-05-01' ) FROM nums ) , dlist2 ( aDay, TGD ) AS ( SELECT aDay, DATEADD( DAY, ( ( 8 - DATEPART( WEEKDAY, aDay ) ) % 7 ) - 3, aDay ) AS ThuOfGivenDay FROM dlist ) SELECT * , DATEPART( YEAR, TGD ) AS [년] , DATEPART( MONTH, TGD ) AS ..
-- 1,2 컬럼값이 서로 같고 3컬럼값만 다른경우 SELECT * FROM A, B WHERE (A.1 = B.1 AND A.2 = B.2) AND A.3 B.3; -- 1,3컬럼값은 같고 2컬럼값만 다른 경우 SELECT * FROM A, B WHERE (A.1 = B.1 AND A.3 = B.3) AND A.2 B.2; -- 2,3컬럼값은 같고 1컬럼값만 다른 경우 SELECT * FROM A, B WHERE (A.2 = B.2 AND A.3 = B.3) AND A.1 B.1; -- 1,2,3 컬럼이 전부 다른 경우 SELECT * FROM A, B WHERE A.1 B.1 AND A.2 B.2 AND A.3 B.3; 출처 - http://www.gurubee.net/article/59245 ---..
ALT + D + F 누르게 되면 자동정렬
SELECT A.POST_ID I_POST_ID, A.NAME AS I_NAME, A.PHONE1 I_R_PHONE1, A.PHONE2 I_R_PHONE2, A.PHONE3 I_R_PHONE3, NVL (B.GUBUN, '신규') AS GUBUN1, A.REGISTER_DT I_REGISTER_DT, A.GUBUN GUBUN, A.EVENT_YN, ROW_NUMBER () OVER (ORDER BY REGISTER_DT DESC) RNM, A.CELLPHONE FROM EVENT A, APLUS_V_CUSTOMER_CELLPHONE B AND A.CELLPHONE = B.CELLPHONE(+) AND A.NAME = B.CUSTOMER_NM(+) ORDER BY A.REGISTER_DT DESC A테이블..
SELECT * FROM ( SELECT CUSTOMER_NM, SUBSTR(REGIDENT_ID, 7, 1), REGIDENT_ID, TRANSLATE (SUBSTR(REGIDENT_ID, 0, 2), 'X0123456789', 'X'), 2012 - TO_NUMBER(DECODE(SUBSTR(REGIDENT_ID, 7, 1), '3', 20, '4', 20, 19) || SUBSTR(REGIDENT_ID, 0, 2)) AS AGE, REGISTER_DT FROM CUSTOMER WHERE SERVICE_CD1 ='Y' AND ACTIVE_YN = '1' AND TRANSLATE (SUBSTR(REGIDENT_ID, 0, 2), 'X0123456789', 'X') IS NULL -- 숫자만 가져오는 -..
- Total
- Today
- Yesterday
- user
- eclipse
- Linux
- 백업
- MySQL
- sql
- tomcat
- java
- select
- DB
- apache
- 윈도우
- Windows
- 설정
- Oracle
- Toad
- 서버
- 테이블
- delete
- 리눅스
- Shell
- IP
- 오라클
- DATABASE
- 파일
- mssql
- server
- 데이터
- table
- 자동차
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |