nativeDistinct
doesn't work when we include orderBy
or take
and limit
in the queries
#22734
Labels
domain/schema
Issue in the "Schema" domain: Prisma Schema, Introspection, Migrations etc.
kind/improvement
An improvement to existing feature and code.
tech/engines/query engine
Issue in the Query Engine
topic: limit
topic: nativeDistinct
topic: orderBy / sorting
topic: postgresql
topic: take
Bug description
Native DISTINCT
doesn't work when we usedorderBy
or use
take
andlimit
The raw queries when used these queries:
It looks like we have to work around this problem by using subqueries: https://stackoverflow.com/questions/9795660/postgresql-distinct-on-with-different-order-by
How to reproduce
.
Expected behavior
No response
Prisma information
I posted them.
Environment & setup
Prisma Version
The text was updated successfully, but these errors were encountered: