Skip to content

Conditionally add WHERE clause? #2196

Answered by adering-cw
rlcurrall asked this question in Q&A
Discussion options

You must be logged in to vote

you can do something like ($1::boolean is null OR active = $1) AND ($2::integer is null OR age > $2) then you can pass the option type into the query

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by rlcurrall
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants