(编辑):在metabase中执行查询的错误:(错误:and&quot&quot&quot'&quot'stose:33)的语法错误
我在Metabase中运行一个非常简单的查询,但是,我遇到了一个错误。 以下是我正在运行的代码:
SELECT user_id
FROM order_order
[[where date_placed between {{from}} and {{to}}]]
and {{partner_id}}
以下是我遇到的错误:
ERROR: syntax error at or near "and" Position: 33
我一直在尝试多种解决此问题的方法,但无法使其工作。感谢您在此查询方面的帮助。我看不到查询的问题。我想念什么?
for Refrence 附加图像
I am running a very simple query in Metabase, however, I am getting an error.
Following is the code I am running:
SELECT user_id
FROM order_order
[[where date_placed between {{from}} and {{to}}]]
and {{partner_id}}
Following is the error I am getting:
ERROR: syntax error at or near "and" Position: 33
I have been trying multiple ways to get this fixed, but couldn't get this to work. I would appreciate your help with this query. I don't see a problem with the query tho. What am I missing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您查询中[[]]内部的语句仅在从或到变量具有选定值时使用。这意味着,当未设置和要设置的两个值(未选择的值)时,您的查询将如下:
因此错误。
为了解决它,您应该将其中的子句设置为始终为真,然后具有所需的条件语句。这是一个示例:
The statement inside the [[ ]] in your query is only used when from or to variables have a selected value. That means that when both from and to are not set (no value selected) your query will be the following:
hence the error.
In order to resolve it you should set the where clause to always true and then have the conditional statements that you want. Here is an example:
我认为您只想:
然后使用高级日期查询进行两部分之间的操作?
全部记忆中,希望我不会离开。
I think you just want:
then use an advanced date query to do the between part?
All from memory so hope I'm not way off.