如何在WHERE子句中对布尔表达式进行分组 [英] How to group boolean expressions in a WHERE clause

查看:54
本文介绍了如何在WHERE子句中对布尔表达式进行分组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

展开 | 选择 | Wrap | 行号

推荐答案

因为您需要将布尔表达式组合在一起,否则它将评估它们seperateley和返回任何匹配其中任何一行的行。


这是你的查询的样子:
Because you need to group your boolean expressions together, or else it will evaluate them seperateley and return any row that matches any of them.

This is how your query should look:
展开 | Sele ct | Wrap | 行号


我编辑了帖子的标题以更好地描述它的内容。

请阅读发布指南发布前

主持人
I have edited the thread''s title to better describe it''s contents.
Please read the Posting Guidlines before posting

Moderator


请给我建议......


i将PartNumber和SupplierName作为我的主要 ..


[PHP]" select * from cbomnew PartNumber not in(从cbom_filtered中选择PartNumber)和( comCode ='''PCEC''或comCode =''LOX''或comCode ='''CCEC'')" [/ PHP]


我如何把它像


选择PartNumber和SupplierName不在(从cbom_filtered中选择PartNumber)?????


i想比较2个数据,这些数据是partnumber和suppliername ..我该怎么做...
Pls advice me...

i have PartNumber and SupplierName as my primary key..

[PHP]"select * from cbomnew where PartNumber not in (select PartNumber from cbom_filtered) and (comCode= ''PCEC''or comCode=''LOX''or comCode=''CCEC'' )"[/PHP]

how do i put like

select PartNumber and SupplierName not in( select PartNumber from cbom_filtered) ?????

i wan to compare 2 data which are partnumber and suppliername.. how do i do that...


这篇关于如何在WHERE子句中对布尔表达式进行分组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆