Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2003
    Location
    Zutphen,Netherlands
    Posts
    256

    Unanswered: order by issue between 9i and 10g

    The following sql runs okay in 9i:

    SELECT TO_CHAR(FIELD1),
    FIELD2,
    FIELD3 FROM TABLE
    ORDER BY FIELD1;

    Testing in 10g shows that this throws an error:
    'Invalid identifier'

    The following does work:

    SELECT TO_CHAR(FIELD1),
    FIELD2,
    FIELD3 FROM TABLE
    ORDER BY 'FIELD1';

    Is this due to a change between 9i and 10g
    Ties Blom
    Senior Application Developer BI
    Getronics Healthcare
    DB2,ORACLE,Powercenter,BusObj,Access,
    SQL, SQL server

  2. #2
    Join Date
    Nov 2003
    Posts
    2,935
    Provided Answers: 12
    Quote Originally Posted by blom0344
    The following sql runs okay in 9i:

    SELECT TO_CHAR(FIELD1),
    FIELD2,
    FIELD3 FROM TABLE
    ORDER BY FIELD1;

    Testing in 10g shows that this throws an error:
    'Invalid identifier'
    Works for me in 10g. Could you show us the real SQL that you are using?
    The following does work:

    SELECT TO_CHAR(FIELD1),
    FIELD2,
    FIELD3 FROM TABLE
    ORDER BY 'FIELD1';
    Which will not sort by field1! It sorts by the constant value 'FIELD1' which will result in no sorting whatsoever.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •