Subject Re: [firebird-support] substring
Author Lester Caine
monaasn wrote:

> I have a table with data :
>
> AA00,BB01,CC00,DD02
>
> I want the data sort by substring from the third char, so the data
> will appear : 00,00,01,02.
>
> If I use SQL on oracle, I can use the syntax :
>
> SELECT SUBSTR(column,2,2) FROM TABLE1
>
> How the syntax can I use with firebird ?

Firebird 1.5 supports the ANSI function SUBSTRING

SELECT SUBSTRING( column FROM 2 FOR 2 ) FROM TABLE

then simply add
ORDER BY 1( the number of the column with the string in)
to sort the results

--
Lester Caine
-----------------------------
L.S.Caine Electronic Services