0
with firstcte (first_name,active) as(
 select first_name,active from customer)
 select * from firstcte 

Error Code: 1064.

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'firstcte (first_name,active) as( select first_name,active from customer) select ' at line 1 0.000 sec

O. Jones
  • 103,626
  • 17
  • 118
  • 172
  • Which MySQL version? – jarlh Sep 22 '22 at 10:27
  • 2
    Does this answer your question? [How can I fix MySQL error #1064?](https://stackoverflow.com/questions/23515347/how-can-i-fix-mysql-error-1064) and/or [WITH statement on MySQL syntax error 1064](https://stackoverflow.com/questions/73153852/with-statement-on-mysql-syntax-error-1064) – Luuk Sep 22 '22 at 10:36
  • Older versions of MySQL don't have CTE support. That's likely your problem. – O. Jones Sep 23 '22 at 10:26
  • With clause was added with MySQL 8.0. Check out your version using `select version()`. https://modern-sql.com/caniuse/with_(non-recursive,_top_level) – Markus Winand Sep 23 '22 at 10:27

0 Answers0