你的条件好相冲突吧:a中存在但B中不存在的ServicePriceID,这时再限制CardType=123没用哦,只有第一个条件起作用select A.*
from ServicePrice A
left join ServiceRebate B on A.ServicePriceID=B.ServicePriceID
where B.ServicePriceID is null
from ServicePrice A
left join ServiceRebate B on A.ServicePriceID=B.ServicePriceID
where B.ServicePriceID is null
解决方案 »
- 求一SQL
- ******搞不定要失业了,快救我,急死了,分不够另开帖加,多表查询问题******
- 关于MySQL出现Lost connection to MySQL server during query的问题
- 加权平均的问题,在线给分
- 把一个列改为主键且自增的语句怎么错了
- 求一储存过程!
- 急。急。关于:未与信任的SQL SERVER连接相关联。?
- 关于一张表循环数据的查询
- 两个相同的字段的表,如何增补?
- sqlserver2000中我要将另一台服务器中的某一数据库中的某几张表增加到现在服务中的的一个数据库中,该怎样做,注意,我发现有导入导出或
- 这样的SQL怎么写,高手来看看!
- 谁有没有办法实现把中文姓名转化成汉语拼音的形式!(和各位探讨以下!)
FROM ServicePrice
WHERE ServicePriceID not in
(
SELECT ServicePriceID
FROM ServiceRebate
WHERE ServiceRebate.CardTypeID = 123
)
FROM a
WHERE ServicePriceID not in (select ServicePriceID from b where CardTypeID = 123)