Skip to content

Fetch all records with entries that do not exist in a join table #2704

Answered by laurenceisla
kvnam asked this question in Q&A
Discussion options

You must be logged in to vote

Hi! I think what you need here is the ANTI JOIN mentioned here: #2584 (comment) . In your case, the query would be:

GET /users?select=*,users_projects()&users_projects=is.null

Also, if the users_projects table references both foreign keys and has them as a composite PK like you mentioned, then you can get the same result embedding projects directly:

GET /users?select=*,projects()&projects=is.null

This is available in the latest pre-release.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@kvnam
Comment options

@kvnam
Comment options

@laurenceisla
Comment options

@kvnam
Comment options

Answer selected by wolfgangwalther
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants