Created
December 6, 2017 22:24
-
-
Save yuba/145a3f3b7f75e4f3e88a614ea5431013 to your computer and use it in GitHub Desktop.
カラムにnullが含まれるなら結果がnullになるmax() ref: https://qiita.com/yuba/items/a402cc00f7e1ce900e4b
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
max(end_date) keep (dense_rank last order by end_date nulls last) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case when count(case when end_date is null then 1 end) = 0 then max(end_date) end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment