```kotlin SELECT * FROM ( SELECT DISTINCT ON (ad...
# exposed
b
Copy code
kotlin
SELECT * FROM (
  SELECT DISTINCT ON (address_id) *
  FROM purchases 
  WHERE product_id = 1
  ORDER BY address_id, purchased_at DESC
) t
ORDER BY purchased_at DESC
what is the equivalent of this in exposed?
t
t
@Brian Carbone, please look at https://github.com/JetBrains/Exposed/issues/500 for DISTINCT ON expression workaround.
b
@tapac I did that, but it's the nested query I had trouble with
117 Views