0

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"

showtime
  • 1
  • 1
  • 17
  • 48

1 Answers1

0

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',
   ]);
showtime
  • 1
  • 1
  • 17
  • 48
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 02 '22 at 15:34