sql 語句問題?

xiayule 2004-02-25 02:38:02
select t3.cust_no, t3.cust_name, left(t1.part_no, 2) as fpart,'三极管TO-92封裝' as ftype, sum(t1.qty) as fqty, sum(round(t1.amt, 2)) as famt
from s_invoice_dt t1
inner join s_invoice_hd t2 on t1.inv_no = t2.inv_no
inner join customer t3 on t2.cust_no = t3.cust_no
where left(part_no, 2) = '03' and substring(t1.part_no,5,1) = 'A' and t2.posted = 1 and t2.cy_id = 'RMB' and t3.cust_no in ('SCM00001,SCM00003,SCQ00007')
group by t3.cust_no, t3.cust_name, left(t1.part_no, 2)

查詢結果為空,如果将上述的t3.cust_no in ('SCM00001,SCM00003,SCQ00007')换成t3.cust_no='SCM00001' or t3.cust_no='SCM00003' or t3.cust_no='SCQ00007'就可以查询到5条记录,为什么?
...全文
21 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复

34,588

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧