sql - Why am I receiving an Error 2F0F5E42 (Missing Parenthesis) in my SQL script when it appears they are all present?
问题描述
We recently updated our Tableau Server to 2021.1.5 and started noticing an error for the following script that was written for us; Error Code 2F0F5E42 - Missing Right Parenthesis. I'm so-so when it comes to SQL so I loaded the SQL script into Sublime and looked for any errors. I could not see any missing parenthesis and it looks like everything should run fun; however, I'm not familiar with using SQL in Tableau.
I was told when they originally ran the script in Tableau they were getting an issue with the date and they changed something in the table for the data and now it's showing the Missing Right Parenthesis. I know that Tableau has some issues with some of the SQL languages so I'm not sure if I shouldn't be including more () in some places.
SELECT A.rate,
A.class,
Count(DISTINCT A.mbrsep),
Sum(B.totalenergy)
FROM V_MV_CA_MEMBERDETL A
INNER JOIN mdmrpt.DAILY_USAGE B ON A.METER=B.METER
WHERE (A.cycle = 0001
OR A.cycle = 0002
OR A.cycle = 0003
OR A.cycle = 0004)
AND B.dailytimestamp BETWEEN to_date(TO_DATE('<Parameters.Year>-<Parameters.Month>-01', 'YYYY-MM-DD')) AND to_date(<Parameters.End Date>)
OR (A.cycle = 0006
OR A.cycle = 0007
OR A.cycle = 0008)
AND A.mbrsep in
(SELECT C.mbrsep
FROM V_MV_CA_MEMBERDETL C
INNER JOIN mdmrpt.DAILY_USAGE D ON C.METER=D.METER
WHERE D.dailytimestamp = to_date(<Parameters.End Date>))
GROUP BY rate
解决方案
推荐阅读
- python - Python Telethon:抓取和存储 Telegram 消息
- ruby-on-rails - Activeadmin年选择只有10年之前
- excel - 我在 VBA 的 for 循环中遇到类型不匹配错误
- c# - Dotnet ClientWebSocket 缓冲区大小
- php - OcotberCMS PivotModel $attachOne 关系
- python - 带有变量的 Python 熊猫 ISIN
- python - 如何根据最新 ForeignKey 中的字段值查询 Django 对象?
- java - 创造无尽模式(记忆游戏)
- java - 如何在远程执行代码时捕获 Selenium WebDriver (Java) 中的警报屏幕截图?
- javascript - 带有 CSS 和 JS 的可滚动 DIV