Skip to content
Advertisement

MySQL Workbench: “SELECT” is not valid at this position for this server version, expecting : ‘(‘, WITH error

I have the following SQL query which I have written in MySQL Workbench:

However, I am getting the following error: “SELECT” is not valid at this position for this server version, expecting : ‘(‘, WITH error. I am relatively new to SQL so I am not sure why I am getting this error and how to resolve this. Any insights are appreciated.

Advertisement

Answer

This is not valid SQL:

Perhaps you intend:

Of course, this is superfluous. You can just use the table and put the filtering in an outer WHERE clause.

I think your error is caused by just some general confusion because the compiler is confused.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement