2 zhang1102344558 zhang1102344558 于 2016.04.20 14:47 提问

数据库出现重复怎么解决,求大神 急急急

select distinct '2016-3',m3.po_num,m3.item_num,max(m3.item_desc) over(partition by m3.po_num, m3.item_num, m3.vendor_num, m3.unit_price_with_tax) as item_desc,
m3.vendor_num,
m3.vendor_name,m3.unit_price_with_tax,m3.unit_price,m3.tax_rate,
m3.ph_creation_date d1,m3.pll_last_update_date d2,
sum(m3.po_real_qty) over(partition by m3.po_num, m3.item_num, m3.vendor_num, m3.unit_price_with_tax) po_real_qty,
sum(m3.PRIMARY_QUANTITY) over(partition by m3.po_num, m3.item_num, m3.vendor_num, m3.unit_price_with_tax) PRIMARY_QUANTITY,
m3.pk_buyer,m3.usdflag,m3.new_price_rate,0
from

(select mv.*,/*rcv.rcv,*/
(select sum(decode(r.transaction_type, 'RECEIVE', 1, -1) * r.QUANTITY)
from epms_erp_rcvqty_info r
where r.LINE_LOCATION_ID = '417100'
and r.rcv_date >= to_date('2016-1-26','yyyy-MM-dd')
and r.rcv_date < to_date('2016-2-26','yyyy-MM-dd')
and r.transaction_type in ('RETURN TO VENDOR', 'RECEIVE')) as PRIMARY_QUANTITY
from po_price_view_mv mv/*,(select r.rcv_date as rcv
from epms_erp_rcvqty_info r
where r.LINE_LOCATION_ID = '417100'
and r.rcv_date >= to_date('2016-1-26','yyyy-MM-dd')
and r.rcv_date < to_date('2016-2-26','yyyy-MM-dd')
and r.transaction_type in ('RETURN TO VENDOR', 'RECEIVE')) rcv*/
where (mv.ph_creation_date >= to_date('2016-1-26','yyyy-MM-dd') and mv.ph_creation_date < to_date('2016-2-26','yyyy-MM-dd') )
or (mv.pll_last_update_date >=to_date('2016-1-26','yyyy-MM-dd') and mv.pll_last_update_date < to_date('2016-2-26','yyyy-MM-dd') ) ) m3

1个回答

CSDNXIAOD
CSDNXIAOD   2016.04.20 14:52

急急急!房屋销售管理系统的数据库
求 助(急急急!!!!!!!)
急急急急!!!!求各位大神们帮助啊,配置运行SSH框架项目出现如下错误,小弟不胜感激啊
----------------------biu~biu~biu~~~在下问答机器人小D,这是我依靠自己的聪明才智给出的答案,如果不正确,你来咬我啊!

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!