ソースコード
WITH HANKAKUUME AS (
  SELECT
    EMP_CODE,
    replace(EMP_LAST_NAME, " ", "") AS `EMP_LAST_NAME`,
    replace(EMP_FIRST_NAME, " ", "") AS `EMP_FIRST_NAME`
  FROM
    EMP
  WHERE
    VALID_FLG = '1'
),
KABURI AS (
  SELECT
    EMP_LAST_NAME || " " || EMP_FIRST_NAME AS LAST_FIRST,
    COUNT(1) AS `CNT`
  FROM
    HANKAKUUME
  GROUP BY
    LAST_FIRST
  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, " ", "") || " " || replace(EMP_FIRST_NAME, " ", "") IN (
    SELECT
      LAST_FIRST
    FROM
      KABURI
  )
  AND VALID_FLG = '1'
ORDER BY
  replace(EMP_LAST_NAME, " ", ""),
  replace(EMP_FIRST_NAME, " ", ""),
  EMP_CODE
提出情報
提出日時2023/02/19 16:49:31
コンテスト第5回 SQLコンテスト
問題同姓同名抽出
受験者jf1hnl
状態 (詳細)AC
(Accepted: 正答)
メモリ使用量98 MB
メッセージ
テストケース(通過数/総数)
3/3
状態
メモリ使用量
データパターン1
AC
80 MB
データパターン2
AC
94 MB
データパターン3
AC
98 MB