Oracle没接触过,建议无人解答就转版

解决方案 »

  1.   

    至今还未听说在SQL Server力可以实现的查询在Oracle实现不了。
    以上无非就是视图+case ,据我所知Oracle里这两个特性都很支持。
      

  2.   

    很感谢,只不过听说oracle用的是DECODE
      

  3.   

    可以,oralce支持的。oracle 9i也有case
      

  4.   

    支持,可以用DECODE改写。
    Select  Caption,
    Sum(decode(AccClassid||Acid,'131300',Ton,0)) 计费顿,
    Sum(decode(AccClassid,'131',Fee,0)) 装卸船收入,
    Sum(decode(AccClassid,'11' ,fee,0)+decode(Acid,'14',Fee,0)) 杂作业收入
    From 
    (
    /* 将相关数据表中用于统计的字段结合成一张表   */
    Select 
    I.ComputerNumber,I.InvoiceDate,
    IDe.AccClassid,IDe.ACid1 As Acid,IDe.Money1 As Fee,IDe.Ton1 As Ton,
    CC.Caption
    From Invoice As I,InvoiceDetail As IDe,Cargo As C,CargoClass As CC
    Where
    I.ComputerNumber=IDe.InvoiceNumber And
    IDe.Cargoid=C.Cargoid and
    C.PLevel11=CC.Plevel11
    ) Group By Caption,
    要分。