Last active
January 22, 2024 14:31
-
-
Save vlapenkov/a09d980c45f8803a3973eb5b753659b7 to your computer and use it in GitHub Desktop.
Использование rank в выражении postgres
This file contains hidden or 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
select carrier.id , cc.car_id , rank (*) over (partition by carrier_id ORDER BY cc.created DESC) | |
from carrier.carrier carrier join carrier.carrier_car cc on carrier.id = cc.carrier_id | |
order by carrier.id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment