Subject Re: Firebird: has ORDER BY in INSERT INTO... FROM being added?
Author Alexander V.Nevsky
--- In ib-support@yahoogroups.com, "Marco Menardi" <mmenaz@l...>
wrote:
> Ordering instead of filtering? I can't see how filtering can make
> sense in the "insert from..." problem I have.

Marco, seems I wrong understood you. I understood - some records
should be copied, some not because trigger raise exception based on
some criteria. In this case this criteria should be included into
Where clause. But you spoke about something like self-referenced
tree-like hierarhical table, am I right this time? If so, FB1.5 will
help you. I spoke not clear enough, sorry, in FB1.5 you can use order
by in _insert from select_ and in _subselect with First 1_. BTW, both
(trees and First) are not members of standard relational data model,
so to get advantages of both is needed additional functionality, not
included into SQL server realizations which were worked out to handle
standard model of sets and they intersection and joining.

> In addition, you learn that a "select" can have the "order by".
Having
> things work or not in different context meas that simple problems
can
> become nightmares when you have to solve them in a different context
> (i.e. a subselect, a where clause, a insert from, etc.).

You forgot peculiarities of usage of Order By in queries with
aggregates and Group By :) This differences are grown not from
somebodie's caprice, believe me. If you'll spend some time trying to
answer yourself - why? - you will reach new level in understanding of
SQL and sets handling.

Best regards, Alexander.