You are on page 1of 9

select a.po_no, b.po_item_no, b.srv_no, to_char (a.srv_date,'mm/dd/yyyy') as srv_date, b.

srv_item_no,
b.svi_challan_qty_punit, b.svi_pay_unit from mmc.srv_header a, mmc.srv_item b where a.srv_no
= b.srv_no and a.srv_date between '01-apr-2011' and '31-dec-2011' and a.supp_code ='S0141' and
b.svi_pay_unit='KG' and substr(b.po_no,1,2) in ('25',65) and b.year_code='1' order by 4;

select a.po_no, b.po_item_no, b.srv_no, to_char (a.srv_date,'mm/dd/yyyy') as srv_date, b.srv_item_no,


b.svi_challan_qty_punit, b.svi_pay_unit from mmc.srv_header a, mmc.srv_item b where a.srv_no
= b.srv_no and a.srv_date between '01-jan-2012' and '31-mar-2012' and a.supp_code ='S0141' and
b.svi_pay_unit='KG' and substr(b.po_no,1,2) in ('69') and b.year_code='1' order by 4;

select a.po_no, b.po_item_no, b.srv_no, to_char (a.srv_date,'mm/dd/yyyy') as srv_date, b.srv_item_no,


b.svi_challan_qty_punit, b.svi_pay_unit from mmc.srv_header a, mmc.srv_item b where a.srv_no
= b.srv_no and a.srv_date between '01-jan-2012' and '31-mar-2012' and a.supp_code ='S0134' and
b.svi_pay_unit='KG' and substr(b.po_no,1,2) in ('25', 65,61,69) and b.year_code='1' order by 4;

select sum( b.svi_challan_qty_punit) from mmc.srv_header a, mmc.srv_item b where a.srv_no =


b.srv_no and a.srv_date between '01-apr-2011' and '30-apr-2011' and a.supp_code ='V0119' and
b.svi_pay_unit='KG' and substr(b.po_no,1,2) in ('21','25','29','61','65','69') and b.year_code='1' ;

select sum( b.svi_challan_qty_punit) from mmc.srv_header a, mmc.srv_item b where a.srv_no=


b.srv_no and a.srv_date between '01-may-2011' and '31-may-2011' and a.supp_code ='V0119' and
b.svi_pay_unit='KG' and substr(b.po_no,1,2) in ('21','25','29','61','65','69') and b.year_code='1' ;

select sum( b.svi_challan_qty_punit) from mmc.srv_header a, mmc.srv_item b where a.srv_no=


b.srv_no and a.srv_date between '01-jun-2011' and '30-jun-2011' and a.supp_code ='V0119' and
b.svi_pay_unit='KG' and substr(b.po_no,1,2) in ('21','25','29','61','65','69') and b.year_code='1';

select sum( b.svi_challan_qty_punit) from mmc.srv_header a, mmc.srv_item b where a.srv_no =


b.srv_no and a.srv_date between '01-jul-2011' and '31-jul-2011' and a.supp_code ='V0119' and
b.svi_pay_unit='KG' and substr(b.po_no,1,2) in ('21','25','29','61','65','69') and b.year_code='1';

select sum( b.svi_challan_qty_punit) from mmc.srv_header a, mmc.srv_item b where a.srv_no =


b.srv_no and a.srv_date between '01-aug-2011' and '31-aug-2011' and a.supp_code ='V0119' and
b.svi_pay_unit='KG' and substr(b.po_no,1,2) in ('21','25','29','61','65','69') and b.year_code='1' ;

select sum( b.svi_challan_qty_punit) from mmc.srv_header a, mmc.srv_item b where a.srv_no=


b.srv_no and a.srv_date between '01-sep-2011' and '30-sep-2011' and a.supp_code ='V0119' and
b.svi_pay_unit='KG' and substr(b.po_no,1,2) in ('21','25','29','61','65','69') and b.year_code='1';

select sum( b.svi_challan_qty_punit) from mmc.srv_header a, mmc.srv_item b where a.srv_no=


b.srv_no and a.srv_date between '01-oct-2011' and '31-oct-2011' and a.supp_code ='V0119' and
b.svi_pay_unit='KG' and substr(b.po_no,1,2) in ('21','25','29','61','65','69') and b.year_code='1';

select sum( b.svi_challan_qty_punit) from mmc.srv_header a, mmc.srv_item b where a.srv_no=


b.srv_no and a.srv_date between '01-nov-2011' and '30-nov-2011' and a.supp_code ='V0119' and
b.svi_pay_unit='KG' and substr(b.po_no,1,2) in ('21','25','29','61','65','69') and b.year_code='1';

select sum( b.svi_challan_qty_punit) from mmc.srv_header a, mmc.srv_item b where a.srv_no=


b.srv_no and a.srv_date between '01-dec-2011' and '31-dec-2011' and a.supp_code ='V0119' and
b.svi_pay_unit='KG' and substr(b.po_no,1,2) in ('21','25','29','61','65','69') and b.year_code='1';

select sum( b.svi_challan_qty_punit) from mmc.srv_header a, mmc.srv_item b where a.srv_no=


b.srv_no and a.srv_date between '01-jan-2012' and '31-jan-2012' and a.supp_code ='V0119' and
b.svi_pay_unit='KG' and substr(b.po_no,1,2) in ('21','25','29','61','65','69') and b.year_code='1';

select sum( b.svi_challan_qty_punit) from mmc.srv_header a, mmc.srv_item b where a.srv_no=


b.srv_no and a.srv_date between '01-feb-2012' and '29-feb-2012' and a.supp_code ='V0119' and
b.svi_pay_unit='KG' and substr(b.po_no,1,2) in ('21','25','29','61','65','69') and b.year_code='1';

select sum( b.svi_challan_qty_punit) from mmc.srv_header a, mmc.srv_item b where a.srv_no=


b.srv_no and a.srv_date between '01-apr-2011' and '31-dec-2011' and a.supp_code ='V0119' and
b.svi_pay_unit='KG' and substr(b.po_no,1,2) in ('21','25','29','61','65','69') and b.year_code='1' ;

select distinct a.po_no, b.po_item_no, c.pod_delivery_date, b.srv_no, to_char (a.srv_date,


'mm/dd/yyyy') as srv_date, b.srv_item_no, b.svi_challan_qty_punit, b.svi_pay_unit
from mmc.srv_header a, mmc.srv_item b, mmc.po_delivery_comt_pk c
where a.srv_no= b.srv_no and
a.srv_date between '01-jan-2012' and '31-mar-2012' and
a.supp_code ='D0112' and
b.svi_pay_unit='KG' and
a.po_no = c.po_no and
b.po_no = c.po_no and
substr(b.po_no,1,2) in ('21','25','29','61','65','69')
and b.year_code='1' order by 1, 2 ;

Motor
Select distinct a.po_no, b.po_item_no, c.pod_delivery_date, b.srv_no, a.srv_date, c.item_value
from mmc.srv_header a, mmc.srv_item b, mmc.po_delivery_comt_pk c
where a.srv_no= b.srv_no and
a.srv_date between '01-apr-2012' and '30-sep-2012' and
b.svi_pay_unit='KG' and
a.po_no = c.po_no and
b.po_no = c.po_no and
substr (c.indent_no,2,3)=327 and

substr (c.indent_no,7,1)=3 and


substr(b.po_no,1,2) in ('25','65')
and b.year_code='2' order by 1, 2 ;

Select distinct c.pod_delivery_date, b.srv_no, a.srv_date, a.po_no, b.po_item_no, c.item_value


from mmc.srv_header a, mmc.srv_item b, mmc.po_delivery_comt_pk c
where a.srv_no= b.srv_no and
a.srv_date between '01-apr-2012' and '30-sep-2012' and
b.svi_pay_unit='KG' and
a.po_no = c.po_no and
b.po_no = c.po_no and
substr (c.indent_no,2,3)=327 and
substr (c.indent_no,7,1)=3 and
substr(b.po_no,1,2) in ('25','65')
and b.year_code='2' order by 1, 2 ;

select po_no, pod_pay_order_qty/1000 as order_in_MT, (pod_pay_order_qtypod_pay_challan_qty)/1000 as balance_in_MT from mmc.po_delivery_comt_pk


where supp_code=''
and substr(po_no,1,2) in ('21','25','29','61','65','69')
and pod_delivery_date between 01-apr-2010 and 31-mar-2013
and (pod_pay_order_qty - pod_pay_challan_qty) > 0.25* pod_pay_order_qty

select sum(pod_pay_order_qty/1000) as order_in_MT, sum (pod_pay_order_qtypod_pay_challan_qty)/1000 as balance_in_MT from mmc.po_delivery_comt_pk


where supp_code='A0195'
and substr(po_no,1,2) in ('21','25','29','61','65','69')
and pod_delivery_date between 01-apr-2011 and 31-mar-2012
and (pod_pay_order_qty - pod_pay_challan_qty) > 0.25* pod_pay_order_qty

select sum( b.svi_challan_qty_punit) from mmc.srv_header a, mmc.srv_item b where a.srv_no

= b.srv_no and a.srv_date between '01-apr-2011' and '31-dec-2011' and a.supp_code ='S0141' and
b.svi_pay_unit='KG' and substr(b.po_no,1,2) in ('69') and b.year_code='1';

Select dt_chd_pcno as PC_NO, dt_chd_dktn as DKT_NO from dtchd001 where


substr(dt_chd_pcno,2,4)=2030 order by 1;

Select dt_drw_pcno as PC_NO, dt_drw_dktn as DKT_NO from dtpar001 where


substr(dt_drw_pcno,2,4)=2030 order by 1;

select distinct a.po_no, a.po_date,a. pod_delivery_date as PO_delivery, a.pod_pay_order_qty as


Ordered, a.pod_pay_challan_qty as Supplied, b.srv_date as SRV_date from mmc.po_delivery_comt_pk
a, mmc.srv_header b, mmc.srv_item c
where a.supp_code='A0195'
and a.supp_code=b.supp_code
and b.srv_no=c.srv_no
and substr(a.po_no,1,2) in ('21','25','29','61','65','69')
and a.po_date between 01-apr-2011 and 31-may-2011
and c.year_code='1'
order by 2

select po_no, po_item_no, po_lot_no, po_date, pod_delivery_date as PO_delivery, pod_pay_order_qty


as Ordered, pod_pay_challan_qty as Supplied from mmc.po_delivery_comt_pk
where supp_code='A0195'
and substr(indent_no,2,3)=321
and substr(po_no,1,2) in ('25','65')
and po_date between 01-apr-2010 and 31-mar-2012

order by 4, 1, 3;

select distinct a.po_no, b.po_item_no, c.pod_delivery_date, b.srv_no, to_char (a.srv_date,


'mm/dd/yyyy') as srv_date, b.srv_item_no, b.svi_challan_qty_punit, b.svi_pay_unit
from mmc.srv_header a, mmc.srv_item b, mmc.po_delivery_comt_pk c
where a.srv_no= b.srv_no and
a.srv_date between '01-jan-2012' and '31-mar-2012' and
a.supp_code ='D0112' and
b.svi_pay_unit='KG' and
a.po_no = c.po_no and
b.po_no = c.po_no and
substr(b.po_no,1,2) in ('21','25','29','61','65','69')
and b.year_code='1' order by 1, 2 ;

select po_no, po_item_no, po_lot_no, po_date, pod_delivery_date as PO_delivery, pod_pay_order_qty


as Ordered, pod_pay_challan_qty as Supplied from mmc.po_delivery_comt_pk
where supp_code='A0195'
and substr(indent_no,2,3)=321
and substr(po_no,1,2) in ('25','65')
and po_date between 01-apr-2010 and 31-mar-2012
order by 4, 1, 3;

Select distinct a.po_no, b.po_item_no, c.pod_delivery_date, b.srv_no, a.srv_date, b.srv_item_no


from mmc.srv_header a, mmc.srv_item b, mmc.po_delivery_comt_pk c
where a.srv_no= b.srv_no and
b.svi_pay_unit='KG' and
a.po_no = c.po_no and
b.po_no = c.po_no and
substr(b.po_no,1,7) in ('6515076')
and a.srv_date > c.pod_delivery_date
and b.year_code='1' order by 1, 2 ;

Select distinct c.po_no, c.po_item_no, c.po_lot_no, b.srv_no, a.srv_date


from mmc.srv_header a, mmc.srv_item b, mmc.po_delivery_comt_pk c
where a.srv_no= b.srv_no and
b.svi_pay_unit='KG' and
a.po_no = c.po_no and
b.po_no = c.po_no and
substr(b.po_no,1,7) in ('6515076')
and b.year_code='1' order by 1, 2 ;

You might also like