Issue Details (XML | Word | Printable)

Key: CORE-2953
Type: Bug Bug
Status: Closed Closed
Resolution: Won't Fix
Priority: Minor Minor
Assignee: Unassigned
Reporter: Leslie Kaye
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Firebird Core

error using select * from X order by Y where Z

Created: 31/Mar/10 10:22 AM   Updated: 31/Mar/10 11:01 AM
Component/s: Engine
Affects Version/s: 2.1.3
Fix Version/s: None

Environment: OpenSuSE 11.2


 Description  « Hide
This statement
select * from NOMINAL_LEDGER where NOMINAL_CODE = ? order by NOMINAL_CODE
works as expected

This statement
select * from NOMINAL_LEDGER order by NOMINAL_CODE where NOMINAL_CODE = ?
returns "Dynamic SQL Error SQL error code = -104 Token unknown - line 2, column 23 where"

It seems that "order by" cannot be used before "where". This gives a problem with TSQLTable generated SQL in Delphi 2006

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Dmitry Yemanov added a comment - 31/Mar/10 10:30 AM
ORDER BY clause *is really* (and *by design*) cannot be used before WHERE. This is the standard SQL syntax. Blame your toolset for ignoring such a well-known rule.