Conditional logic with variables (if {{a}} = 1 then QUERY1 else QUERY2)

I wonder if there is a possibility to use variables for conditional logic.
Basically I would like to modify query depending on variable value.

If variable == 'something' use 1 set of columns for select and if not - slightly different.

Is it possible?

at least with clickhouse I found the way out:

if({{a}} = 1, column1, {{a}} = 2, column2, column3) as needed_column