我的思路:
1、从数据库中按物料号和日期筛选出来一定的记录,把记录放入一个新的表中
select
a.item_no, b.note,b.graph_no, a.line_no, a.qty_get,
a.pur_rate_amt, a.act_sum, a.tax_sum, c.supply_code,
a.date_get
from get_detail a,item b,get_head c
where a.get_no = c.get_no
and a.item_no =b.item_no
and a.item_no like '01%'
and to_char(get_detail.date_get,'yyyy-mm-dd')>='2008-07-01'
and to_char(get_detail.date_get,'yyyy-mm-dd')>='2008-07-31';
2、物料号是唯一性,物料号不同,材料则不一样。
删除记录中:同一个物料号只从一个供应商购买的记录
因为价格没有可对比性。
3、对剩下的记录进行分析
同一个物料在不同厂商的购买数量、价格注:item_no :物料号 note:名称 graph_no:规格 line_no:单据号 qey_get:购买数量 pur_rate_amt:暂估价格 act_sum:实际价格
tax_sum:税 supply_code:供应商代码 date_get:到货日期
1、从数据库中按物料号和日期筛选出来一定的记录,把记录放入一个新的表中
select
a.item_no, b.note,b.graph_no, a.line_no, a.qty_get,
a.pur_rate_amt, a.act_sum, a.tax_sum, c.supply_code,
a.date_get
from get_detail a,item b,get_head c
where a.get_no = c.get_no
and a.item_no =b.item_no
and a.item_no like '01%'
and to_char(get_detail.date_get,'yyyy-mm-dd')>='2008-07-01'
and to_char(get_detail.date_get,'yyyy-mm-dd')>='2008-07-31';
2、物料号是唯一性,物料号不同,材料则不一样。
删除记录中:同一个物料号只从一个供应商购买的记录
因为价格没有可对比性。
3、对剩下的记录进行分析
同一个物料在不同厂商的购买数量、价格注:item_no :物料号 note:名称 graph_no:规格 line_no:单据号 qey_get:购买数量 pur_rate_amt:暂估价格 act_sum:实际价格
tax_sum:税 supply_code:供应商代码 date_get:到货日期
解决方案 »
- 数据库毕业设计 做个什么好呢
- Microsoft.Jet.OLEDB.4.0 连接ACCESS 中执行异常
- 菜鸟请教:app_folder_move_cursor('1')是什么意思
- 请教oracle的索引表(index-organized table)
- 这种语语句怎么关联
- 请大哥大姐赐教 自增字段在sql server 2000和oracle中的区别
- 讨论:有关各种数据库的优缺点(主要讨论Sybase、Oracle和Microsoft三大公司的数据库产品)--------------参与有分
- 在linux下import一个windows下建的库的DMP文件,产生了乱码!
- 请教:oracle8i的ManagementServer无法认证?为什么?一定给分
- oracle关于连接奇怪的问题
- 关于 oci 和 occi 的问题
- Oracle转换成SQL
where item_no in (
select item_no
from (select distinct item_no,supply_code from 表名 )
group by item_no
having count(supply_code)=1)