Subject Re: [firebird-support] ORDER BY clause in VIEWs
Author Helen Borrie
At 12:00 AM 2/08/2003 -0700, you wrote:
>While creating a View in a FireBird 1.0 database, I observed a
>weird behaviour. When I included an ORDER BY clause in the
>SELECT query, it failed to compile, flagging the word ORDER as
>an invalid token. However when I removed the ORDER BY clause,
>without changing the rest of the query, it compiled fine.
>Has anyone else experienced this problem? Also what could be
>the reason of the problem? Since the view compiled fine without
>the ORDER BY clause and the compiler specifically flagged the
>ORDER word, I have not included the query text.
>Thanks in advance for any tips and suggestions,

Quite simple - you can't include an ORDER BY clause in a view specification.

If you want the output from your view to be ordered, just use an ORDER BY
clause when your SELECT from YOURVIEW.