MySQL Workbench reports “is not valid at this position for this server version” error

前端 未结 3 1506
不思量自难忘°
不思量自难忘° 2020-12-17 10:52

For the following SQL query:

SELECT COUNT (distinct first_name) from actor;

I receive the following error message:

\"SELECT         


        
3条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-17 11:36

    I know this isn't the exact problem you stated, but this was the same error message I was getting. The message is so generic that it could be anything...

    So, from one newbie to another:

    For me, the error occurred when I nested one query within another. I had a ; at the end of the first query and forgot to take it out. That threw the error. Once I deleted the ; in the inner query and added one at the end of the new query the error resolved.

    Error:

    Select
    From (....
        Select
        From
        Where
        Group by
        Order ;     <== offending ;
    ) as ...
    Where
    Group by
    Order
    

    No Error:

    Select
    From (....
        Select
        From
        Where
        Group by
        Order
    ) as ...
    Where
    Group by
    Order ;   <== correct placement
    

提交回复
热议问题