Why do you want to define a variable in SQL before running the SELECT .... and not actually using the variable ?
It also looks like you're using Custom SQL - no real need for that either
Basically, you can't declare a variable like that in Tableau, and what are you going to do with it if you could ?
Sorry, I should have been more clear. This is a simplified version of the query and the variable is used. And, I use it to transform another variable which I filter on, which is why I can't just declare it in Tableau.
There's no way around it though. If you're using Custom SQL then declare the parameter in Tableau and pass the value to Oracle. Within the SELECT statement you have to modify the value.
Tableau always "wraps" the SQL in a subquery, which is why it doesn't work, because this doesn't work in Oracle either (at a guess)
SELECT * FROM
DEFINE Next_Year = '2018'