Select parent rows where child exists
I want to use a relational query to select all users and their posts where users have at least one post.
5 Replies
This is from my code. You can use the
exists
method to filter rows based on a subquery.
Drizzle ORM - Filters
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
@Sillvva Maybe I'm just missing something, but it doesn't appear to do what I want.
Does that look right? Because that still just returns every user.
That worked, thank you very much!