ID Dst Channel destination
1 123
2 123
3 SIP/5raghami-00043236 91026
5 SIP/5raghami-00043232 91132
6 SIP/107-00043230 123
7 Local/123@from-queue-00006326;1 802
以下查询仅打印 6,7。我想要的输出是 1,2,6,7
SQL = "SELECT id,duration FROM result where destination='123' or (destination='802' and [Dst Channel] like '%Local/123%')"
RS.Open SQL, con
while not rs.eof
response.write rs("id")
rs.movenext
wend
rs.close
我认为第 1 行和第 2 行被忽略,因为 [Dst Channel] 为空。我写的查询有问题吗?(也许有问题)