ソースコード
INSERT INTO
DEPARTMENT
    (DEPT_CODE,
    START_DATE,
    END_DATE,
    DEPT_NAME,
    LAYER,
    UP_DEPT_CODE,
    VALID_FLG,
    UPDATE_USER_NAME,
    USER_UPDATE_DATETIME)
VALUES
    ('B300',
    'B300',
    NULL,
    '新設部門',
    (SELECT DISTINCT LAYER FROM DEPARTMENT WHERE DEPT_CODE = 'A100'),
    (SELECT DISTINCT UP_DEPT_CODE FROM DEPARTMENT WHERE DEPT_CODE = 'A100'),
    1,
    (SELECT DISTINCT UPDATE_USER_NAME FROM DEPARTMENT WHERE DEPT_CODE = 'A100'),
    '2023-04-01 00:00:00');
/*
DEPT_CODE = 'B300'
START_DATE = 'B300'
END_DATE = NULL
DEPT_NAME = '新設部門'
LAYER = 'A100'のLAYER
UP_DEPT_CODE = 'A100'のUP_DEPT_CODE
VALID_FLG = '1'
UPDATE_USER_NAME = 'A100'のUPDATE_USER_NAME
USER_UPDATE_DATETIME = '2023-04-01 00:00:00'
*/
UPDATE DEPARTMENT
SET
    END_DATE = '2023-03-31'
    ,VALID_FLG = '0'
    ,UPDATE_USER_NAME = 'ORG_CHG'
    ,USER_UPDATE_DATETIME = '2023-03-31 23:59:59'
WHERE DEPT_CODE IN ('A100', 'A200');

/*
END_DATE = '2023-03-31'
VALID_FLG = '0'
UPDATE_USER_NAME = 'ORG_CHG'
USER_UPDATE_DATETIME = '2023-03-31 23:59:59'
*/
UPDATE EMP
SET
    DEPT_CODE ='B300'
    ,START_DATE = '2023-04-01'
    ,UPDATE_USER_NAME = 'ORG_CHG'
    ,USER_UPDATE_DATETIME = '2023-04-01 00:00:00'
WHERE DEPT_CODE IN ('A100', 'A200') AND VALID_FLG = '1';

/*
DEPT_CODE ='B300'
START_DATE = '2023-04-01'
UPDATE_USER_NAME = 'ORG_CHG'
USER_UPDATE_DATETIME = '2023-04-01 00:00:00'
*/
/*
SELECT *
FROM DEPARTMENT;

SELECT *
FROM EMP;
*/
提出情報
提出日時2023/07/09 23:03:13
コンテスト第6回 SQLコンテスト
問題組織変更
受験者daidai07
状態 (詳細)RE
(Runtime Error: 実行時エラー)
メモリ使用量77 MB
メッセージ
SQLITE_MISUSE: not an error
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
RE
77 MB
データパターン2
RE
76 MB