In the DB Query reader, the preview tries to wrap you query with
select * from ( *yourquery*) as temptablename LIMIT 10
so that it can preview the first 10 rows.
The problem is that your query contains -- comments
Your entire query is taken as a single string and linefeeds are ignored when this gets turned into the “preview query”, and as a result the first of those comments effectively comment out the remainder of the query.
Either remove the comments or replace -- mycomment
with
`/* mycomment */
I can’t say that this is the cause of your general problem (there may be something else wrong) but hopefully this will move you forward
The real hurdle was with group by all. I tried to remove group by all and use group by 1,2,3,etc. and it worked. It seems that it does not like the group by command.
Hi @gt4, I’ve not encountered group by all before, and even group by [ordinal list] doesn’t work with a number of sql dialects, but I’m glad you got it working.