Heim > Fragen und Antworten > Hauptteil
有个问题请教下大伙。
有一张表,有很多个字段,每次都是随机的几个的字段需要根据收到的报文进行insert或者update,这句sql语句应该怎么样拼接呢?
报文的格式如下,["字段名",“值”]
['num', '01'], ['time', '20150227152120'], ['cccttt', '18.2'], ['cccuuu', '78'], ['ccctdd', '14.3'], ['cccppp', '1014.87'], ['cccqfe', '1014.5'], ['cccqnh', '1016.4'], ['cccprr', '0.0'], ['ccc1prr', '0.0'], ['ccc60prr', '0.0'], ['ccc60prrtime', '00'], ['ccc1maxfs', '5.0'], ['ccc1minfs', '2.2'], ['cccprevailfs', '3.0'], ['cccprevailfx', '120'], ['ccc24maxfs', '8.8'], ['ccc24maxfx', '120'], ['ccc24maxfstime', '12:35'], ['ccc24minfs', '1.2'], ['ccc24minfx', '120'], ['ccc24minfstime', '04:45'], ['cccmaxrh', '99'], ['cccmaxrhtime', '00:55'], ['cccminrh', '78'], ['cccminrhtime', '15:01'], ['npd', '04L'], ['light', '3']
每条报文的长度都是随机的。