0

My query structure is like below.

WITH cte1 AS (SELECT a, b FROM table1) SELECT * FROM cte1;

but it comes with below error

Unrecognized statement type. (near "WITH" at position 0)

I have checked my MySQL version with mysql --version command and my MySQL version is mysql Ver 14.14 Distrib 5.7.25, for Linux (x86_64) using EditLine wrapper

It's an issue with the "with" keyword.

Can you please help me with this concern?

Bill Karwin
  • 538,548
  • 86
  • 673
  • 828
Rav's Patel
  • 743
  • 6
  • 22

1 Answers1

3

Use MySQL version 8+, or MariaDB 10.2+, if you need common table expressions.

O. Jones
  • 103,626
  • 17
  • 118
  • 172