You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
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:
Thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions