ソースコード
WITH CleanedData AS (
    SELECT 
        EMP_CODE as CODE, 
        SURNAME, 
        NAME, 
        REPLACE(SURNAME, ' ', '') AS cleaned_surname, 
        REPLACE(NAME, ' ', '') AS cleaned_name
    FROM EMP
)
SELECT 
    c.CODE, 
    c.SURNAME, 
    c.NAME
FROM 
    CleanedData c
INNER JOIN 
    CleanedData c2 ON c.cleaned_surname = c2.cleaned_surname 
                  AND c.cleaned_name = c2.cleaned_name 
                  AND c.CODE != c2.CODE
WHERE 
    (c.cleaned_surname, c.cleaned_name) IN (
        SELECT 
            cleaned_surname, cleaned_name
        FROM 
            CleanedData
        GROUP BY 
            cleaned_surname, cleaned_name
        HAVING 
            COUNT(*) > 1
    )
ORDER BY 
    c.cleaned_surname ASC, 
    c.cleaned_name ASC, 
    c.CODE ASC;
提出情報
提出日時2023/12/08 09:09:26
コンテスト第5回 SQLコンテスト
問題同姓同名抽出
受験者doro
状態 (詳細)RE
(Runtime Error: 実行時エラー)
メモリ使用量83 MB
メッセージ
SQLITE_ERROR: no such column: SURNAME
テストケース(通過数/総数)
0/3
状態
メモリ使用量
データパターン1
RE
82 MB
データパターン2
RE
83 MB
データパターン3
RE
83 MB