Subject | Re: [firebird-support] "select first" will not work in a VIEW.. |
---|---|
Author | Helen Borrie |
Post date | 2005-04-11T23:21:01Z |
At 09:46 PM 11/04/2005 +0000, you wrote:
create ordered sets using views.
What you need to do is define your view to encompass the set and then
define the restricted set by placing the SELECT FIRST and the ORDER BY in
the request statement, i.e.
select first 10 <fieldlist> from aView
order by beecom_item_id DESCENDING;
However, for your example, it's entirely unnecessary to put a view behind
this set, since it can be got directly using your SELECT statement.
./heLen
>This statement will not work for a VIEW:Correct. SELECT FIRST operates on an ordered output set. You cannot
>
>select first 10 start_price, title, BEECOM_ITEM_ID from vendor_item
>order by beecom_item_id DESCENDING;
>
>
>Here is the error:
>
>Invalid token.
>Dynamic SQL Error.
>SQL error code = -104.
>Token unknown - line 5, char 8.
>first.
create ordered sets using views.
What you need to do is define your view to encompass the set and then
define the restricted set by placing the SELECT FIRST and the ORDER BY in
the request statement, i.e.
select first 10 <fieldlist> from aView
order by beecom_item_id DESCENDING;
However, for your example, it's entirely unnecessary to put a view behind
this set, since it can be got directly using your SELECT statement.
./heLen