sqlsap-iq

Using LIST and sorting in Sybase IQ - multiple LIST selects throws off "ORDER BY"?


My query does something like...

LIST( column1, " ;" ORDER BY column2)

This works. When I add more LIST functions in my SELECT then the ORDER BY is ignored. Anyone know why that might be occurring? I'd like to avoid doing unions or running the queries separately then joining


Solution

  • The documentation suggests that there are restrictions on the use of multiple ORDER BY clauses:

    "A query block containing more than one aggregate function with valid ORDER BY clauses can be executed if the ORDER BY clauses can be logically combined into a single ORDER BY clause."