ORACLE

记录一下TIPTOP

#1
回复 yaner 2015-11-11, 1:25 PM
select img01 as 料号,ima02 as 品名,img02 as 仓库,img03 as 库位,img04 as 批次,img10 as 数量,img09 as 单位,img15 as 入库日,c.obg21 as 单价,(c.obg21*img10*3.5) as 金额 from img_file,ima_file,
(select a.obg02,a.obg21,a.obg09 from obg_file a
  where a.obgdate = (select max(b.obgdate) from obg_file b where a.obg02 = b.obg02)) c
where img01=ima01 and img02='A101' and img10>0
  and img01=c.obg02
order by (c.obg21*img10) desc


select sum((c.obg21*img10*3.5)) as 库存总金额 from img_file,ima_file,
(select a.obg02,a.obg21,a.obg09 from obg_file a
  where a.obgdate = (select max(b.obgdate) from obg_file b where a.obg02 = b.obg02)) c
where img01=ima01 and img02='A101' and img10>0
  and img01=c.obg02


select img01 as 料号,ima02 as 品名,img02 as 仓库,img03 as 库位,img04 as 批次,img10 as 数量,img09 as 单位,img15 as 入库日,c.obg21 as 单价,(c.obg21*img10*9) as 金额 from img_file,ima_file,
(select a.obg02,a.obg21,a.obg09 from obg_file a
  where a.obgdate = (select max(b.obgdate) from obg_file b where a.obg02 = b.obg02)) c
where img01=ima01 and img02='A108' and img10>0
  and img01=c.obg02
order by (c.obg21*img10) desc

select sum((c.obg21*img10*9)) as 库存总金额 from img_file,ima_file,
(select a.obg02,a.obg21,a.obg09 from obg_file a
  where a.obgdate = (select max(b.obgdate) from obg_file b where a.obg02 = b.obg02)) c
where img01=ima01 and img02='A108' and img10>0
  and img01=c.obg02

select img01 as 料号,ima02 as 品名,img02 as 仓库,img03 as 库位,img04 as 批次,img10 as 数量,img09 as 单位,img15 as 入库日,c.obg21 as 单价,(c.obg21*img10*25) as 金额 from img_file,ima_file,
(select a.obg02,a.obg21,a.obg09 from obg_file a
  where a.obgdate = (select max(b.obgdate) from obg_file b where a.obg02 = b.obg02)) c
where img01=ima01 and img02='A101' and img10>0
  and img01=c.obg02
order by (c.obg21*img10) desc

   select sum((c.obg21*img10*25)) as 库存总金额 from img_file,ima_file,
(select a.obg02,a.obg21,a.obg09 from obg_file a
  where a.obgdate = (select max(b.obgdate) from obg_file b where a.obg02 = b.obg02)) c
where img01=ima01 and img02='A107' and img10>0
  and img01=c.obg02
发表评论