AWS Timestream "Not equal" 比较引发错误
AWS Timestream "Not equal" comparison throws error
我有一个查询,我想在其中获取“已完成”字段不等于 0 的所有数据,但它会引发错误。我不明白为什么他们 documentation 支持这些比较。
$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#ValidationException,
'<>' cannot be applied to varchar, integer"
修复如下:
$result = $query_client->query([
'MaxRows' => 1,
'QueryString' => 'SELECT field1, field2, completed, date
FROM \"db\".\"table\"
WHERE completed = '" . 0 . "'
ORDER BY date DESC',
]);
我有一个查询,我想在其中获取“已完成”字段不等于 0 的所有数据,但它会引发错误。我不明白为什么他们 documentation 支持这些比较。
$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#ValidationException, '<>' cannot be applied to varchar, integer"
修复如下:
$result = $query_client->query([
'MaxRows' => 1,
'QueryString' => 'SELECT field1, field2, completed, date
FROM \"db\".\"table\"
WHERE completed = '" . 0 . "'
ORDER BY date DESC',
]);