ソースコード
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",
              "2023-04-01",
              NULL,
              "新設部門",
              (SELECT LAYER
               FROM DEPARTMENT
               WHERE DEPT_CODE = "A100"),
              (SELECT UP_DEPT_CODE
               FROM DEPARTMENT
               WHERE DEPT_CODE = "A100"),
              "1",
              (SELECT UPDATE_USER_NAME
               FROM DEPARTMENT
               WHERE DEPT_CODE = "A100"),
              "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");
UPDATE EMP SET DEPT_CODE ="B300",
               START_DATE ="2023-04-01",
               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';
提出情報
提出日時2023/06/02 13:14:38
コンテスト第6回 SQLコンテスト
問題組織変更
受験者korogu
状態 (詳細)AC
(Accepted: 正答)
メモリ使用量78 MB
メッセージ
テストケース(通過数/総数)
2/2
状態
メモリ使用量
データパターン1
AC
78 MB
データパターン2
AC
78 MB