Receiving CTE syntax error with 10.1.48-MariaDB-0ubuntu0.18.04.1

467 views Asked by At

Beginner with MariaDB and trying to understand the syntax. I’m trying to create the simplest example and then build from there. Shouldn’t the following work?

with myCTE as 
  (SELECT 1 as MyNum, 'A' as MyChar  
  UNION  
  SELECT 2 as MyNum, 'B' as MyChar)  
SELECT *  
FROM myCTE  

I’m looking at the following three references and believe that I am adhering to their approach:

  1. https://www.mariadbtutorial.com/mariadb-basics/mariadb-cte/
  2. https://www.mysqltutorial.org/mysql-cte/
  3. https://mariadb.com/kb/en/non-recursive-common-table-expressions-overview/

I’m sure I’m missing something simple, but just can’t see it.
Using MariaDB and TablePlus on iPad and I get generic error message:

You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'myCTE as ( … Thanks for the assistance… First question on Stackoverflow

0

There are 0 answers