日期:2014-05-16 浏览次数:20683 次
SELECT
SUM(cost*ld_qty_oh) AS js,
SUM(ld_qty_oh) AS js1
FROM VIEW_ld_det
WHERE (
((pt_prod_line NOT LIKE 'cut%') AND
(pt_prod_line<>'mold') AND
(ltrim(pt_prod_line)<>'spa') AND
(pt_prod_line<>'raad') AND
(Type<>'somi') AND
(Type <> 'wip') AND
(Type <> 'wipn') AND
(ld_loc <> 'cl13') AND
(pt_prod_line NOT LIKE 'c%')) OR
((pt_prod_line NOT LIKE 'cut%') AND
(pt_prod_line<>'mold') AND
(ltrim(pt_prod_line)<>'spa') AND
(pt_prod_line<>'raad') AND
(Type<>'somi') AND
(Type = 'wip') AND
(ld_loc <> 'cl13') AND
(pt_prod_line NOT LIKE 'c%')) OR
((pt_prod_line NOT LIKE 'cut%') AND
(pt_prod_line<>'mold') AND
(ltrim(pt_prod_line)<>'spa') AND
(pt_prod_line<>'raad') AND
(Type<>'somi') AND
(Type = 'wipn') AND
(ld_loc <> 'cl13') AND
(pt_prod_line NOT LIKE 'c%'))) and
rq='2012-01-21'
SELECT SUM(cost * ld_qty_oh) AS js ,
SUM(ld_qty_oh) AS js1
FROM VIEW_ld_det
WHERE ( ( pt_prod_line NOT LIKE 'cut%' )
AND ( pt_prod_line <> 'mold' )
AND ( LTRIM(pt_prod_line) <> 'spa' )
AND ( pt_prod_line <> 'raad' )
AND ( Type <> 'somi' )
AND ( Type <> 'wip' )
AND ( Type <> 'wipn' )
AND ( ld_loc <> 'cl13' )
AND ( pt_prod_line NOT LIKE 'c%' )
)
AND rq = '2012-01-21'
UNION ALL
SELECT SUM(cost * ld_qty_oh) AS js ,
SUM(ld_qty_oh) AS js1
FROM VIEW_ld_det
WHERE ( ( pt_prod_line NOT LIKE 'cut%' )
AND