已创建edgex流propertyInforPubProfile ,从edgex获取设备上线的事件,想要通过LEFT JOIN方式获取设备名称。
SQL如下:
SELECT deviceId,iot_device.name as deviceName FROM (
SELECT meta(deviceName) AS deviceId, latest(onlineStatus) as onlineStatusL FROM propertyInforPubProfile WHERE onlineStatusL = 1 GROUP BY deviceId,TUMBLINGWINDOW(ss, 10)
) LEFT JOIN iot_device ON deviceId = iot_device.device_key
报错信息如下:
Update rule error: Invalid rule json: Parse SQL SELECT deviceId,iot_device.name as deviceName FROM ( SELECT meta(deviceName) AS deviceId, latest(onlineStatus) as onlineStatusL FROM propertyInforPubProfile WHERE onlineStatusL = 1 GROUP BY deviceId,TUMBLINGWINDOW(ss, 10) ) LEFT JOIN iot_device ON deviceId = iot_device.device_key error: found “(”, expected EOF…