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