I'm getting an error trying to use CTEs for `INSER...
# questions-and-troubleshooting
e
I'm getting an error trying to use CTEs for
INSERT INTO
jobs. Can someone please tell me what is wrong with my syntax? Please any help will be greatly appreciated. Error:
Copy code
Error 1064 (HY000): Getting syntax error at line 56, column 4. Detail message: No viable statement for input 'WITH event_with_lag AS (.....
Query:
Copy code
WITH name AS (...)
  INSERT INTO (...)
  SELECT (...)
е
in starrocks it is insert into with … select
🙌 1
1
e
I thought that syntax was to provide labels?
е
yes, it is confusing
e
Can this be clarified in the docs for future devs?
A simple example will suffice
е
i’m not a dev, you can create an issue or make a pull request for docs
👍 1
e
Okay thanks. Also, I assume by "yes, it is confusing" you mean that you put
WITH
after the
INSERT TO
in both labeling and CTE situations?
е
i tried to search for the docs but ended up testing by hand
👍 1