aws iot sql like

0

SELECT clientId() as clientId, CASE clientId() WHEN 'bus_#' THEN 'bus' WHEN 'car_#' THEN 'car' ELSE 'noThingType' END as thingType FROM '$aws/events/#'

clientId : bus_001, bus_002, car_aaa, car_bbb

You can search the connection history through AWS IoT SQL: FROM '$aws/events/#'. The clientId is fixed in the front and variable in the back. I want to look up thingType by looking at clientId. Is there an AWS IoT SQL that behaves like MySQL? please answer about my question. Thanks in advance.

preguntada hace 4 meses124 visualizaciones
1 Respuesta
0

Hi. The startswith() or substring() functions may be of interest.

Alternatively you might consider to use a Lambda to process the events, particularly if you've used registry thing types.

profile pictureAWS
EXPERTO
Greg_B
respondido hace 4 meses
  • answer thank you. clientId random string. example) train_001, airport_111, ... So. startwith() or substring() function cannot be used.

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas