0

Are there any rules governing the use of mixed case column in Snowflake pivot tables? I have the following:

create or replace VIEW vw_tag_avg_by_qrtr_hour
as
SELECT t1.*
FROM (SELECT "Quarter Hour Time",
             "Tag Description",
...
order by 1

I cannot replace "1" by "Quarter Hour Time". PowerBI chokes on this. HOWEVER, if I use

FROM (SELECT "Quarter Hour Time" QRTR_HOUR_TIME,

both order by QRTR_HOUR_TIME and PowerBI are fine. This looks like a bug to me.

Simeon Pilgrim
  • 22,906
  • 3
  • 32
  • 45
Jeffrey Jacobs
  • 302
  • 1
  • 4
  • What happens when you execute the query on Snowflake Console? Could it be related with Power BI? – Gokhan Atil Mar 28 '20 at 22:00
  • `ORDER BY 1` is perfectly valid SQL why would you feel you need to replace it? Have "English text" in your database smells like UI in the DB which as you are finding is tricky to work with, which is related to just do not do that, and drop the quotes also if you can. – Simeon Pilgrim Mar 29 '20 at 19:57
  • Quote columns should also be valid syntax; that is actually what my question is about. Even using "1", the quoted column is still causing problems elsewhere, i.e. PowerBI. The quoted column show up properly in DESC. – Jeffrey Jacobs Mar 30 '20 at 17:55
  • 1, Quoted mixed case column in ORDER BY doesn't work everywhere (Snowflake and SQL Workbench). 2. Even weirder, I added a second mixed case column in #2 position. PowerBI choked on it as well, even though mixed case columns #3 and #4 positions still work fine. When there were only 3 columns, mixed case in #2 and #3 were fine in PowerBI. I have workarounds, which is why I asked if there are any known "rules" regarding this behavior. – Jeffrey Jacobs Mar 30 '20 at 18:06

0 Answers0