3

I am inserting a custom SQL into QS to query my DB; the query contains a CTE and some selection from the same like below:

with cte as
(
    .....
)
select * 
from cte;

Whenever I run the query in QS, I get a syntax error.

sourceErrorMessage: Incorrect syntax near the keyword 'with'

Any help on the syntax or whether CTEs are supported or not by QS would be helpful.

Thank you.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • Assuming Quicksight supports CTEs, I suspect there is a prior statement which does not end in a semicolon, try *;with* ... – John Cappelletti Dec 22 '19 at 14:56
  • Thank you for your response @JohnCappelletti. I had tried this earlier as well, doesn't work. Unable to find any documentation as well for it. – AltafParkar Dec 24 '19 at 02:12
  • I faced the same issue, no matter where to place the semicolon, it complains about 'With' in my Sql server script. The workaround is to use subquery instead. – Rez.Net Feb 22 '21 at 19:33
  • I cannot even create SQL Server temporary table in my custom queries using Select Into, or Create table #tempTable. – Rez.Net Feb 25 '21 at 21:58

0 Answers0