다양한 데이터 추출방법

/*
    직급 코드가 G1(대리) 인 직원
*/

SELECT EMPNO
            ,JUMIN_NO
            ,EMP_NAME
            ,BIRTH_DATE
            ,JIKGB_CODE
FROM LKDM_A01
WHERE JIKGB_CODE IN ('G1');


/*
    직급 코드가 G1(대리) 인 직원
*/

SELECT EMPNO
            ,JUMIN_NO
            ,EMP_NAME
            ,BIRTH_DATE
            ,JIKGB_CODE
FROM LKDM_A01
WHERE JIKGB_CODE = 'G1'

 

/*
 직급 코드가 G1(대리) 인 직원
*/
SELECT EMPNO
            ,JUMIN_NO
            ,EMP_NAME
            ,BIRTH_DATE
            ,JIKGB_CODE
FROM LKDM_A01
WHERE JIKGB_CODE IN (SELECT JIKGB_CODE
                                      FROM LKDM_A92
                                      WHERE JIKGB_NAME='대 리')

 

/*
    직급코드가 G1 인 직원
*/
SELECT EMPNO
            ,JUMIN_NO
            ,EMP_NAME
            ,BIRTH_DATE
            ,JIKGB_CODE
FROM LKDM_A01
WHERE EXISTS    (SELECT JIKGB_CODE
                         FROM LKDM_A92
                         WHERE JIKGB_CODE = LKDM_A01.JIKGB_CODE
                         AND JIKGB_CODE='G1')

 

'정보처리기술사' 카테고리의 다른 글

FP 측정유형  (0) 2012.05.16
비교후 데이터 추출  (0) 2012.05.08
DECODE, SUBSTR, TO_CHAR  (0) 2012.05.08
인덱스 특징  (0) 2012.05.07
BPO(Business Process Outsourcing)  (0) 2011.06.16