Subject Re: [firebird-support] Named columns in Select
Author Ann W. Harrison
Tim Gahnström wrote:

> I don't know how it is implemented but it certainly looks like the below will make two runs through the table, once in the select and once in the group by doing essentially the same thing.
>
> select substring(name from 1 for 1)
> from T_MOVIES
> where name=name
> group by substring(name from 1 for 1)
> into :ltr_out
>

No. It makes a single pass retrieving the data and performing the sort
for the grouping. It then goes through the sorted stream, picking out
the value for each group.


Regards,



Ann