我有一些代码必须再次编写才能准备好生产。代码很乱,我有几行表示 sql 查询,但我无法解析确切的语句。
qs = 'DEVICENAME1|DEVICENAME2|DEVICENAME3'
qstring='SELECT "lat", "lon", "device", "location" FROM "locations" WHERE ("device" =~ /^('+qs+')/) AND time > now()-60h'
qstring='SELECT "device", "lat" FROM "locations" WHERE ("location"=~ /^'+loc+'$/) AND time > now()-60h'
如果有人能为我解决 sql 查询语句,我将不胜感激。需要明确的是,我对这些部分感兴趣:
("device" =~ /^('+qs+')/)
("location"=~ /^'+loc+'$/)