ソースコード
INSERT INTO DEPARTMENT(
DEPT_CODE,
START_DATE,
END_DATE,
DEPT_NAME,
LAYER,
UP_DEPT_CODE,
VALID_FLG,
UPDATE_USER_NAME,
USER_UPDATE_DATETIME
)
SELECT 
'B300' AS DEPT_CODE ,
'2023-04-01' AS START_DATE ,
NULL AS END_DATE ,
'新設部門' AS DEPT_NAME,
LAYER ,
UP_DEPT_CODE ,
'1' AS VALID_FLG ,
UPDATE_USER_NAME ,
'2023-04-01 00:00:00' AS USER_UPDATE_DATETIME 
FROM DEPARTMENT
WHERE
DEPT_CODE ='A100';

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
E.DEPT_CODE ='B300',
E.START_DATE = '2023-04-01',
E.UPDATE_USER_NAME = 'ORG_CHG',
E.USER_UPDATE_DATETIME = '2023-04-01 00:00:00'
FROM EMP AS E
LEFT JOIN DEPARTMENT AS D ON
D.DEPT_CODE=E.DEPT_CODE AND
D.START_DATE=E.START_DATE 

WHERE
E.VALID_FLG=1 AND
D.DEPT_CODE IN ('A100','A200')
提出情報
提出日時2023/04/14 23:38:27
コンテスト第6回 SQLコンテスト
問題組織変更
受験者ketupablakistoni
状態 (詳細)RE
(Runtime Error: 実行時エラー)
メモリ使用量83 MB
メッセージ
SQLITE_ERROR: near ".": syntax error
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
RE
79 MB
データパターン2
RE
83 MB