本帖最后由 zhouyequ 于 2013-09-13 09:55:50 编辑

解决方案 »

  1.   

    明显的语法错误 join on这样试试select T1.name,T1.jdbc,T2.hibernate,T3.spring
    from
    (select name, score as jdbc from course where course='jdbc')T1
    join 
    (select name, score as hibernate from course where course='hibernate')T2 
    on T1.name=T2.name 
    join 
    (select name, score as spring from course where course='spring')T3
     on T2.name=T3.name;
      

  2.   

    ORA-00911: 无效字符
    00911. 00000 -  "invalid character"
    *Cause:    identifiers may not start with any ASCII character other than
               letters and numbers.  $#_ are also allowed after the first
               character.  Identifiers enclosed by doublequotes may contain
               any character other than a doublequote.  Alternative quotes
               (q'#...#') cannot use spaces, tabs, or carriage returns as
               delimiters.  For all other contexts, consult the SQL Language
               Reference Manual.
    *Action:
    行 3 列 7 出错
      

  3.   

    ORA-00911: 无效字符
    00911. 00000 -  "invalid character"
    *Cause:    identifiers may not start with any ASCII character other than
               letters and numbers.  $#_ are also allowed after the first
               character.  Identifiers enclosed by doublequotes may contain
               any character other than a doublequote.  Alternative quotes
               (q'#...#') cannot use spaces, tabs, or carriage returns as
               delimiters.  For all other contexts, consult the SQL Language
               Reference Manual.
    *Action:
    行 3 列 7 出错11g测试没有问题,但是jdbc,spring查询没数据
      

  4.   

    ORA-00911: 无效字符
    00911. 00000 -  "invalid character"
    *Cause:    identifiers may not start with any ASCII character other than
               letters and numbers.  $#_ are also allowed after the first
               character.  Identifiers enclosed by doublequotes may contain
               any character other than a doublequote.  Alternative quotes
               (q'#...#') cannot use spaces, tabs, or carriage returns as
               delimiters.  For all other contexts, consult the SQL Language
               Reference Manual.
    *Action:
    行 3 列 7 出错
    这样才对,左连接
    WITH course AS
     (SELECT 'marry' NAME, 'jdbc' COURSE, 85 SCORE
        FROM DUAL
      UNION
      SELECT 'marry' NAME, 'hibernate' COURSE, 75 SCORE
        FROM DUAL
      UNION
      SELECT 'tom' NAME, 'spring' COURSE, 70 SCORE FROM DUAL)
    select T.name,T1.jdbc,T2.hibernate,T3.spring
    FROM
    (select DISTINCT NAME from course) T
    LEFT JOIN
    (select name, score as jdbc from course where course='jdbc')T1
    ON T.NAME=T1.NAME
    LEFT JOIN 
    (select name, score as hibernate from course where course='hibernate')T2 
    on T.name=T2.name 
    LEFT join 
    (select name, score as spring from course where course='spring')T3
     on T.name=T3.name;