-
Notifications
You must be signed in to change notification settings - Fork 150
-
Hello guys! Currently I have a problem with sorting of distinct rows from my table(I want to sort by only one field that is not present in distinct()) and found solution that is written on raw SQL. I am newbie so I don't know how should I do the same construction, but in python-gino:
SELECT * FROM
(SELECT DISTINCT ON (address_id) purchases.address_id, purchases.*
FROM "purchases"
WHERE "purchases"."product_id" = 1 ORDER BY address_id DESC )
ORDER BY purchased_at DESC
Thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment