选择给出不同结果的查询
我已经编写了选择以下查询,但令人惊讶的是,查询中的任何错误都给出了不同的结果。请告诉我。询问:
Select count(*) Count from conflux.dbo.SABR_Master M
Where M.Email in (
select top 26 Email from conflux.dbo.SABR_Master L
where (L.titleid In (Select titleid From sabr_titlemasters Where IsDisplay=1 And title like '%Account Executive%' OR title like '%Account Manager%' OR title like '%Accounts Manager%' OR title like '%admin%' ))
) and M.Email NOT IN (select Email from [sample client].dbo.Comm_CompanyData)
I have written the select fallowing query but it is giving different results surprisingly any wrong in the query. pls let me know. Query:
Select count(*) Count from conflux.dbo.SABR_Master M
Where M.Email in (
select top 26 Email from conflux.dbo.SABR_Master L
where (L.titleid In (Select titleid From sabr_titlemasters Where IsDisplay=1 And title like '%Account Executive%' OR title like '%Account Manager%' OR title like '%Accounts Manager%' OR title like '%admin%' ))
) and M.Email NOT IN (select Email from [sample client].dbo.Comm_CompanyData)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
试试这个,
我在您的标题两边添加了括号,例如“OR”和“订购依据”,以保持您的 26 封电子邮件相同。如果未指定 order by,数据库可能会以随机顺序返回它们,这可能会给出不同的结果。
Try this
I have added brackets around your title like OR's and an Order By to keep your 26 emails the same. The database can return them in a random order if order by is not specified, which can give you different results.