Subject Re: [IB-Conversions] question about sql IN firebrid??????
Author Helen Borrie
At 05:02 PM 11-01-02 +0900, you wrote:
>In sqlsever, this statement is success..
>
>' select * from person order by substring(account,1,2) asc ;'
>
>But In firebird , it's failed...
>
>I want to user substring In order by clause....
>How can I do????

You can't order by an expression but, if you select substring(account,1,2) as an output field, you can order by it as follows:

select substring(account,1,2) as Sortfield, * from person
order by 1 asc

(But it will be horrendously slow). You are better to include an indexed case-insensitive ordering column in your table and do your sorting on that.

regards,
Helen

All for Open and Open for All
Firebird Open SQL Database ยท http://firebirdsql.org
_______________________________________________________