Results 1 to 3 of 3

Thread: Alias not work!

  1. #1
    Join Date
    Mar 2003
    Location
    Rome
    Posts
    12

    Angry Unanswered: Alias not work!

    Sorry, I've another problem:
    This is my situation:

    SELECT Sum(Field1) as Sum1, Sum(Field2) as Sum2, CASE WHEN Sum(field1)=Sum(field2) THEN 'TRUE_string' ELSE 'FALSE_string' END as State
    FROM MyTable
    WHERE State='TRUE_string'


    but Sybase return me: "Invalid column name 'State'.", WHY???

    Thanks.

  2. #2
    Join Date
    Mar 2001
    Location
    Lexington, KY
    Posts
    606
    Malformed case.

    Do:

    SELECT ... "State" = CASE WHEN ... END
    Thanks,

    Matt

  3. #3
    Join Date
    Mar 2003
    Location
    Rome
    Posts
    12

    Talking

    OK, thank you.

Posting Permissions

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