Syntax error: WITH is not valid input in this position

前端 未结 2 961
北海茫月
北海茫月 2021-01-14 15:01

So I have this similar request

    WITH customers_in_usa AS (
        SELECT 
           customerName, state
        FROM
           customers
        WHERE
         


        
2条回答
  •  南笙
    南笙 (楼主)
    2021-01-14 15:37

    WITH customers_in_usa AS is for now invalid MySQL code. MySQL will support CTE's in the future in MySQL version 8..

    You could rewrite your SQL code, that should give the same results.

    SELECT 
        customerName
      , state
    FROM 
       customers 
    WHERE
       country = 'USA'
     AND
       state = 'CA'
    ORDER BY
       customerName
    

提交回复
热议问题