Subject | Re: [firebird-support] Strange behaviour with ORDER BY |
---|---|
Author | Arno Brinkman |
Post date | 2005-12-22T10:18:49Z |
Hi Heiko,
1+1 is an expression, thus you're sorting on the value 2 (not column position 2)!
Regards,
Arno Brinkman
ABVisie
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
General database developer support:
http://www.databasedevelopmentforum.com
Firebird open source database (based on IB-OE) with many SQL-99 features:
http://www.firebirdsql.org
http://www.firebirdsql.info
Support list for Interbase and Firebird users:
firebird-support@yahoogroups.com
Nederlandse firebird nieuwsgroep:
news://newsgroups.firebirdsql.info
> It's not a problem for me but I just came across this strangeWell, it depends on what you expect ;-)
> behaviour of Firebird 1.5.2
>
> Firebird notices wrong column-positions like this
>
> SELECT col1, col2, col3 FROM ... ORDER BY 0
> or
> SELECT col1, col2, col3 FROM ... ORDER BY 4
>
> But it also accepts commands like this
>
> SELECT col1, col2, col3 FROM ... ORDER BY -1
> SELECT col1, col2, col3 FROM ... ORDER BY 1+1
> SELECT col1, col2, col3 FROM ... ORDER BY 3-1
> ...
>
> but doesn't give the "expected" results or errors.
1+1 is an expression, thus you're sorting on the value 2 (not column position 2)!
Regards,
Arno Brinkman
ABVisie
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
General database developer support:
http://www.databasedevelopmentforum.com
Firebird open source database (based on IB-OE) with many SQL-99 features:
http://www.firebirdsql.org
http://www.firebirdsql.info
Support list for Interbase and Firebird users:
firebird-support@yahoogroups.com
Nederlandse firebird nieuwsgroep:
news://newsgroups.firebirdsql.info