ソースコード
WITH HANKAKUUME AS (
  SELECT
    EMP_CODE,
    replace(EMP_LAST_NAME, " ", "") AS `EMP_LAST_NAME`,
    replace(EMP_FIRST_NAME, " ", "") AS `EMP_FIRST_NAME`
  FROM
    EMP
),
KABURI AS (
  SELECT
    EMP_LAST_NAME,
    EMP_FIRST_NAME,
    COUNT(1) AS `CNT`
  FROM
    HANKAKUUME
  GROUP BY
    EMP_LAST_NAME,
    EMP_FIRST_NAME
  HAVING
    CNT > 1
)

SELECT
  EMP_CODE AS `CODE`,
  EMP_LAST_NAME AS `SURNAME`,
  EMP_FIRST_NAME AS `NAME`
FROM
  EMP
WHERE
  replace(EMP_LAST_NAME, " ", "") IN (
    SELECT
      EMP_LAST_NAME
    FROM
      KABURI
  )
  AND replace(EMP_FIRST_NAME, " ", "") IN (
    SELECT
      EMP_FIRST_NAME
    FROM
      KABURI
  )
  AND VALID_FLG = '1'
ORDER BY
  replace(EMP_LAST_NAME, " ", ""),
  replace(EMP_FIRST_NAME, " ", ""),
  EMP_CODE
提出情報
提出日時2023/02/19 16:24:01
コンテスト第5回 SQLコンテスト
問題同姓同名抽出
受験者jf1hnl
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量94 MB
メッセージ
テストケース(通過数/総数)
0/3
状態
メモリ使用量
データパターン1
WA
92 MB
データパターン2
WA
88 MB
データパターン3
WA
94 MB