Troubleshoot common issues with SQL queries in Amazon IoT Analytics - Amazon IoT Analytics
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

End of support notice: On December 15, 2025, Amazon will end support for Amazon IoT Analytics. After December 15, 2025, you will no longer be able to access the Amazon IoT Analytics console, or Amazon IoT Analytics resources. For more information, visit this Amazon IoT Analytics end of support.

Troubleshoot common issues with SQL queries in Amazon IoT Analytics

Use the following information to help troubleshoot issues with your SQL queries in Amazon IoT Analytics.

  • To escape a single quote, precede it with another single quote. Don't confuse this with a double quote.

    Example
    SELECT 'O''Reilly'
  • To escape underscores, use backticks to enclose data store column names that begin with an underscore.

    Example
    SELECT `_myMessageAttribute` FROM myDataStore
  • To escape names with numbers, enclose data store names that include numbers in double quotes.

    Example
    SELECT * FROM "myDataStore123"
  • To escape reserved keywords, enclose reserved keywords in double quotes. For more information, see List of Reserved Keywords in SQL SELECT Statements.