试试这样看看
1,select distinct d.goodscode 货物编号,
d.googsname 货物编号,
tmp.s 销量, (tmp.s * d.price) 销售额
from detail d,
(select t.goodscode, sum(t.nums) over(partition by t.goodscode) s
from temp t
where t.salestime between to_date('2014-09-30', 'yyyy-MM-dd') and
to_date('2017-09-30', 'yyyy-MM-dd')) tmp
where d.goodscode = tmp.goodscode
2,select t1.googsname 货物名称, t1.price 价格, count(t1.googsname) 出现次数
from item t1
group by t1.googsname, t1.price
select a.货物编码, a.货物名称, sum(b.数量) 销量, sum(a.单价 * b.数量) 销售额
from detail a
inner join b on a.货物编码 = b.货物编码
where b.销售时间 between to_date('2017-07-01 00:00:00', 'yyyy-mm-dd hh24:mi:ss') and to_date('2017-09-30 23:59:59', 'yyyy-mm-dd hh24:mi:ss')
group by a.货物编码, a.货物名称
select 货物名称, 单价, count(*) 重复次数
from detail
group by 货物名称, 单价
having count(*) > 1