How to configure multiple optional variables in SQL Question

I am trying to create a SQL question with multiple optional variables but I can't figure how to implement it

SELECT name, email, username, date_of_joining
FROM Person
WHERE [[ name = {{name}}]] AND [[ email = {{email}}]]
ORDER BY date_of_joining DESC;

Now I am unable to figure out how to make the AND and WHERE clause optional here.

Hi @random009
Have a look here: https://www.metabase.com/docs/latest/questions/native-editor/sql-parameters#optional-clauses

1 Like