随笔-295  评论-26  文章-1  trackbacks-0

select NVL(b.Name, ' ') AS spec, ' ' as packs,
'' as Quant,
'' as Price,

 NVL(a.feeamount,0) as amount, ' ' as cpbh,' ' as cpname, ' ' as jidw
from ITM_Documentfee a  left join
sys_datadictionary b on b.id=a.feeid    

union
select
NVL(b.Spec, ' ') AS spec,
NVL(b.field1,' ') as packs,
case Quant
 when 0 then
  ' '
 when null then
  ' '
 else
   to_char(Quant) 
end as Quant
,
case Price
 when 0 then
  ' '
 when null then
  ' '
 else
   to_char(Price) 
end as Price
,
  NVL(b.Amount, 0) AS amount,
c.SerialNumber as cpbh,NVL(c.EnName, ' ') AS cpname,
NVL(t.Symbol, ' ') AS jidw
from ITM_SalesCommodity b
left join CRM_Commodity c ON c.TypeID = b.CommodityTypeID
LEFT OUTER JOIN      BSE_MeasureStyle t ON b.QuantUnitID = t.ID


select ISNULL(b.Name, ' ') AS spec, ' ' as packs,
'' as Quant,
'' as Price,

 isnull(a.feeamount,0) as amount, ' ' as cpbh,' ' as cpname, ' ' as jidw
from ITM_Documentfee a  left join
sys_datadictionary b on b.id=a.feeid    

union
select
ISNULL(b.Spec, ' ') AS spec,
isnull(b.field1,' ') as packs,
Quant =
case
 when Quant>0 then
  CAST( Quant AS varchar(20))
 else ''
end
,
Price =
case
 when Price>0 then
  CAST( Price AS varchar(20))
 else ''
end
,
  ISNULL(b.Amount, 0) AS amount,
c.SerialNumber as cpbh,ISNULL(c.EnName, ' ') AS cpname,
ISNULL(t.Symbol, ' ') AS jidw
from ITM_SalesCommodity b
left join CRM_Commodity c ON c.TypeID = b.CommodityTypeID
LEFT OUTER JOIN      BSE_MeasureStyle t ON b.QuantUnitID = t.ID



大盘预测 国富论
posted on 2007-07-27 13:44 华梦行 阅读(94) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航: