Skip to content

Instantly share code, notes, and snippets.

@yssymmt
Last active March 16, 2022 16:34
Show Gist options
  • Save yssymmt/e715127fc2066aeaded2b62258550982 to your computer and use it in GitHub Desktop.
Save yssymmt/e715127fc2066aeaded2b62258550982 to your computer and use it in GitHub Desktop.
select
顧客番号,
契約番号,
row_number() over(partition by 顧客番号,契約番号 order by 更新日付 desc) as rndesc
from データベース名.テーブル名
qualify rndesc=1
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment