I need to set constant variables in the SQL editor.
For example, I want to create a variable X that runs a query:
SET @X := SELECT AVG(Y) FROM TABLE.
Then, I want to use that variable in the next line:
SELECT * FROM TABLE2 WHERE attribute1 = @X
How can I do this?
Thanks!