用SQL语句保存数据到TDengine数据库的问题

各位大师好!
我要使用规则引擎保存数据到tdengine数据库中遇到问题。
我的订阅数据是:{
“device”: “AA51”,
“sendtime”: 1728007296435,
“values”: {
“status”: “ON”,
“UA”: 211.27,
“UB”: 211.47,
“UC”: 229.81,
“UAB”: 370.23,
“UBC”: 366.88,
“UAC”: 372.75,
“IA”: 901.96,
“IB”: 1100.32,
“IC”: 1168.95,
“F”: 51.98
}
}
是一个json的嵌套格式,我想把values中的字段提取出来跟device和sendtime一起组成一新的payload,交到执行插入数据库的动作,我使用的SQL语句选择如下:
SELECT
paylosd.device as payload.device,
paylosd.sendtime as payload.sendtime,
paylosd.values.status as payload.status,
paylosd.values.UA as payload.UA,
paylosd.values.UB as payload.UB,
paylosd.values.Uc as payload.UC,
paylosd.values.UAB as payload.UAB,
paylosd.values.UBC as payload.UBC,
paylosd.values.UAC as payload.UAC,
paylosd.values.IA as payload.IA,
paylosd.values.IB as payload.IB,
paylosd.values.uhmn6IC as payload.IC,
paylosd.values.F as payload.F
FROM “pub/values/interval1”
但是经过测试得到的选择结果是不对的,,如下所示:不知道错在哪里?
{
“payload”: {
“status”: “undefined”,
“sendtime”: “undefined”,
“device”: “undefined”,
“UC”: “undefined”,
“UBC”: “undefined”,
“UB”: “undefined”,
“UAC”: “undefined”,
“UAB”: “undefined”,
“UA”: “undefined”,
“IC”: “undefined”,
“IB”: “undefined”,
“IA”: “undefined”,
“F”: “undefined”
}
}返回的undefind错误,如何解决

拼写错了,

应该是 payload。

1 个赞

谢谢!