I have a relatively long union select:
select A, B from table1 where C='xxx'
union select A, B from table2 where C='xxx'
union select A, B from table3 where C='xxx'
...
I would like to define xxx as a user-defined variable so I don't have to repeat the condition many time. Unfortunately my MySQL client (visualization) does not support multiple statements so I cannot use SET in the beginning. Is there a way to include the user-defined variable into such statement without changing the SQL output?