20180516 纠结,

1,坚持,持续,一不小心,又落下半月时间没有学习
2,有些贪心,又忙着考研的学习,又补回学习编程,最后西瓜芝麻会不会都没落下


阅读更多

NOT IN 的纠结

02-21

select distinct ww.strike_billno fromrn ( select h.strike_billno ,h.stotalprice ,i.pk_corp ,i.cvendormangid from cg_invoice i ,cg_invoice_b h where i.pk_id_invoice = h.pk_id_invoice and i.cvendormangid = '0001551000000000K9BA' and i.pk_corp = '1007' ) ww , rn (select hh.strike_billno ,nvl(sum(hh.itotalprice),0) itotal ,ii.pk_corp ,ii.cvendormangid from cg_invoice ii ,cg_invoice_b hh where ii.pk_id_invoice = hh.pk_id_invoice and ii.cvendormangid = '0001551000000000K9BA' and ii.pk_corp = '1007' group by hh.strike_billno ,ii.pk_corp ,ii.cvendormangid )wqrn where wq.strike_billno =ww.strike_billno and wq.pk_corp = ww.pk_corp and wq.cvendormangid = ww.cvendormangid and ww.stotalprice = wq.itotal ; 得到三条数据:CF0905130001 CF0906020003 CF0906090003 rnrnrnselect a.vinvoicecode,a.dinvoicedate,c.invcode,c.invname,b.ninvoicenum,b.noriginalcurprice,b.noriginalcurmny rn from bd_invbasdoc c,po_invoice a,po_invoice_b b rn where a.cinvoiceid=b.cinvoiceid rn and b.cbaseid=c.pk_invbasdoc rn and a.pk_corp='1007'rn and a.cvendormangid='0001551000000000K9BA' and a.vinvoicecode not in ('CF0905130001 ','CF0906020003 ' ,'CF0906090003 ')得到29条数据(NOT IN 此时有效果)rnrnrnselect a.vinvoicecode,a.dinvoicedate,c.invcode,c.invname,b.ninvoicenum,b.noriginalcurprice,b.noriginalcurmny rn from bd_invbasdoc c,po_invoice a,po_invoice_b b rn where a.cinvoiceid=b.cinvoiceid rn and b.cbaseid=c.pk_invbasdoc rn and a.pk_corp='1007'rn and a.cvendormangid='0001551000000000K9BA' and a.vinvoicecode not in rnrn( select distinct ww.strike_billno fromrn ( select h.strike_billno ,h.stotalprice ,i.pk_corp ,i.cvendormangid from cg_invoice i ,cg_invoice_b hrn where i.pk_id_invoice = h.pk_id_invoice and i.cvendormangid = '0001551000000000K9BA' and i.pk_corp = '1007' rn ) ww , rn (select hh.strike_billno ,nvl(sum(hh.itotalprice),0) itotal ,ii.pk_corp ,ii.cvendormangid from cg_invoice ii ,cg_invoice_b hhrn where ii.pk_id_invoice = hh.pk_id_invoice and ii.cvendormangid = '0001551000000000K9BA' and ii.pk_corp = '1007' group by hh.strike_billno ,rn ii.pk_corp ,ii.cvendormangid ) wqrn where wq.strike_billno =ww.strike_billno and wq.pk_corp = ww.pk_corp and wq.cvendormangid = ww.cvendormangid and ww.stotalprice = wq.itotal rn );得到34条数据,NOT IN 没发挥出效果!!!rnrnrn为什么?

没有更多推荐了,返回首页