Retrieve data with a SELECT statement in AWS IoT SiteWise - AWS IoT SiteWise

Retrieve data with a SELECT statement in AWS IoT SiteWise

The SELECT statement is used to retrieve data from one or more views. AWS IoT SiteWise supports an implicit JOIN of the views. You can list the views to join (in the FROM clause of the SELECT statement), using commas to separate them.

Use the following SELECT statement:

SELECT select_expr [, ...] [ FROM from_item [, ...] ] [ WHERE [LIKE condition ESCAPE condition] ]

In the previous example, the LIKE clause specifies the search and filtering conditions using wild cards. AWS IoT SiteWise supports percentage (%) as the wild card character.

Example to use % in a condition:
Prefix search: String% Infix search: %String% Suffix search: %String
Example to search for an asset:
SELECT asset_name, asset_description FROM asset WHERE asset_name LIKE 'Wind%'
Example to search for an asset using an ESCAPE condition:
SELECT asset_name, asset_description FROM asset WHERE asset_name LIKE 'room\%' ESCAPE '\'