:::: 개발 ::::/::: MSSQL :::

mssql 에서 샘플 테이블 만드는법

nayha 2014. 2. 19. 14:13
반응형

mssql 에서 샘플 테이블 만들때  ^^ 참고하세용

SELECT * INTO HAP_TEST FROM 
(
    SELECT 1 seq, -2000 amt 
    UNION ALL SELECT 2, 4000 
    UNION ALL SELECT 3, -5000 
    UNION ALL SELECT 4, -2000 
    UNION ALL SELECT 5, 3000 
    UNION ALL SELECT 6, 1500 
    UNION ALL SELECT 7, -250 
    UNION ALL SELECT 8, 320 
    UNION ALL SELECT 9, -4000 
    UNION ALL SELECT 10, 10000 
    UNION ALL SELECT 11, -20000 
) a



oracle


CREATE TABLE HAP_TEST  AS
    SELECT 1 seq, -2000 amt FROM dual
    UNION ALL SELECT 2, 4000 FROM dual
    UNION ALL SELECT 3, -5000 FROM dual
    UNION ALL SELECT 4, -2000 FROM dual
    UNION ALL SELECT 5, 3000 FROM dual
    UNION ALL SELECT 6, 1500 FROM dual
    UNION ALL SELECT 7, -250 FROM dual
    UNION ALL SELECT 8, 320 FROM dual
    UNION ALL SELECT 9, -4000 FROM dual
    UNION ALL SELECT 10, 10000 FROM dual
    UNION ALL SELECT 11, -20000 FROM dual
;


반응형