0

大家好,每个人在查询数据库时都非常菜鸟,我在使用后提出了奇怪的数组行为

select DISTINCT TEST,DIARY_NO 
FROM Laboratory.dbo.DEMAND_DETAILS 
WHERE DIARY_NO='RMU-442' AND (TEST='Bitumen Test' OR  TEST='Softening Point' OR TEST='Flash Point/Fire Point' OR TEST='Penetration of Bituminous Material')

在我的 php 脚本中

与该查询对应的数组是这样出现的

[{"id":"RMU-442","test":"Flash Point\/Fire Point","key":"tests"}]
[{"id":"RMU-442","test":"Flash Point\/Fire Point","key":"tests"},{"id":"RMU-442","test":"Softening Point","key":"tests"}]

我想要的是

[{"id":"RMU-442","test":"Flash Point\/Fire Point","key":"tests"},{"id":"RMU-442","test":"Softening Point","key":"tests"}]

任何有关这方面的帮助都会很棒 提前非常感谢

4

1 回答 1

0

尝试IN

WHERE DIARY_NO='RMU-442' AND TEST IN ('Bitumen Test','Softening Point','Flash Point/Fire Point','Penetration of Bituminous Material')
于 2013-07-13T05:27:29.857 回答