ソースコード
SELECT 
E1.EMP_CODE AS CODE
,E1.EMP_LAST_NAME AS SURNAME
,E1.EMP_FIRST_NAME AS NAME
FROM EMP AS E1
LEFT JOIN EMP AS E2
ON   (REPLACE(E1.EMP_LAST_NAME," ","") || REPLACE(E1.EMP_FIRST_NAME," ","")= (E2.EMP_LAST_NAME ||E2.EMP_FIRST_NAME) 
     and E1.EMP_CODE <> E2.EMP_CODE) or 
     ((E1.EMP_LAST_NAME ||E1.EMP_FIRST_NAME) = REPLACE(E2.EMP_LAST_NAME," ","") || REPLACE(E2.EMP_FIRST_NAME," ","")
     and E1.EMP_CODE <> E2.EMP_CODE)
WHERE E1.VALID_FLG = '1' and  E2.VALID_FLG = '1'
ORDER BY REPLACE(E1.EMP_LAST_NAME," ",""), REPLACE(E1.EMP_FIRST_NAME," ",""), E1.EMP_CODE
提出情報
提出日時2023/02/18 10:47:33
コンテスト第5回 SQLコンテスト
問題同姓同名抽出
受験者mika
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量78 MB
メッセージ
テストケース(通過数/総数)
1/3
状態
メモリ使用量
データパターン1
AC
76 MB
データパターン2
WA
78 MB
データパターン3
WA
77 MB