aws timestream“不等”比较引发错误

发布于 2025-01-25 15:40:53 字数 440 浏览 3 评论 0原文

我有一个查询,我想获取所有“完成”字段不等于0的数据,但会引发错误。我不明白为什么为什么他们的

$result = $query_client->query([
    'MaxRows' => 1,
    'QueryString' => 'SELECT field1, field2, completed, date 
FROM "db"."table"
WHERE completed != 0  // Tried as "0" as well, doesnt work
ORDER BY date DESC',
]);

错误:

com.amazonaws.timestream.v20181101.Query#verialationException, '<>'不能应用于varchar,整数

I have a query where I want to fetch all data where "completed" field is not equal to 0, but it throws an error. I dont get it why as their documentation supports these comparisons.

$result = $query_client->query([
    'MaxRows' => 1,
    'QueryString' => 'SELECT field1, field2, completed, date 
FROM "db"."table"
WHERE completed != 0  // Tried as "0" as well, doesnt work
ORDER BY date DESC',
]);

Error:

com.amazonaws.timestream.v20181101.query#ValidationException,
'<>' cannot be applied to varchar, integer"

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

澜川若宁 2025-02-01 15:40:53

像这样修复了它:

   $result = $query_client->query([
     'MaxRows' => 1,
     'QueryString' => 'SELECT field1, field2, completed, date 
      FROM \"db\".\"table\"
      WHERE completed =  '" . 0 . "'
      ORDER BY date DESC',
   ]);

Fixed it like this:

   $result = $query_client->query([
     'MaxRows' => 1,
     'QueryString' => 'SELECT field1, field2, completed, date 
      FROM \"db\".\"table\"
      WHERE completed =  '" . 0 . "'
      ORDER BY date DESC',
   ]);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文