ソースコード
select
    EMP_CODE as CODE,
    EMP_LAST_NAME as SURNAME,
    EMP_FIRST_NAME as NAME
    
from
    (
    select
        replace(emp_last_name, " ", "") as surname,
        replace(emp_first_name, " ", "") as name,
        replace(emp_last_name, " ", "") || replace(emp_first_name, " ", "") as fullname
    from
        (
        select
            *
        from
            emp
        where
            valid_flg = 1
        )
    group by
        fullname
    having
        count(fullname) > 1
    ) as sur_cnt

inner join
    emp
on
    sur_cnt.surname = replace(emp.emp_last_name, " ", "")
and
    sur_cnt.name = replace(emp.emp_first_name, " ", "")
where
    valid_flg = 1
order by
    replace(emp.emp_last_name, " ", "") asc,
    replace(emp.emp_first_name, " ", "") asc,
    emp_code asc;
提出情報
提出日時2023/02/17 16:46:54
コンテスト第5回 SQLコンテスト
問題同姓同名抽出
受験者UT
状態 (詳細)AC
(Accepted: 正答)
メモリ使用量98 MB
メッセージ
テストケース(通過数/総数)
3/3
状態
メモリ使用量
データパターン1
AC
82 MB
データパターン2
AC
82 MB
データパターン3
AC
98 MB