sql server NEWID() 踩坑记

记录下踩过的坑...

该语句查询的结果集不一致

SELECT * FROM dbo.new_phonecodeBase WHERE  statecode=0 and new_phonecodeId <> NEWID() and new_phoneproductcode='5650730'

 

建议更换用法

SELECT * FROM dbo.new_phonecodeBase WHERE  statecode=0 and new_phonecodeId <>00000000-0000-0000-0000-000000000000and new_phoneproductcode='5650730'

 

posted @ 2021-10-19 15:51  拾梦小侠ด้้้  阅读(91)  评论(0编辑  收藏  举报