ソースコード
SELECT
    EMP_CODE AS CODE,
    EMP.EMP_LAST_NAME AS SURNAME,
    EMP.EMP_FIRST_NAME AS NAME
FROM (
    SELECT
        *,
        REPLACE(EMP_LAST_NAME, " ", "") AS last_name,
        REPLACE(EMP_FIRST_NAME, " ", "") AS first_name
        
    FROM
        EMP
) AS EMP
INNER JOIN (
    SELECT
        *
    FROM (
        SELECT
            EMP_LAST_NAME,
            EMP_FIRST_NAME,
            COUNT(1) AS cnt
        FROM (
            SELECT
                REPLACE(EMP_LAST_NAME, " ", "") AS EMP_LAST_NAME,
                REPLACE(EMP_FIRST_NAME, " ", "") AS EMP_FIRST_NAME
            FROM
                EMP
            WHERE
                VALID_FLG = 1
        )
        GROUP BY
            EMP_LAST_NAME,
            EMP_FIRST_NAME
    )
    WHERE
        cnt >= 2
) AS logs
ON
    EMP.last_name = logs.EMP_LAST_NAME
    AND EMP.first_name = logs.EMP_FIRST_NAME
ORDER BY
    EMP.last_name ASC,
    EMP.first_name ASC,
    EMP_CODE ASC
提出情報
提出日時2023/02/19 23:34:05
コンテスト第5回 SQLコンテスト
問題同姓同名抽出
受験者koya_346
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量94 MB
メッセージ
テストケース(通過数/総数)
1/3
状態
メモリ使用量
データパターン1
AC
94 MB
データパターン2
WA
78 MB
データパターン3
WA
94 MB