Re: Newbie question on returned rows
Posted in 1999
To select the last row in a query ...
How about changing the default ascending to descending in the "ORDER BY"
instruction, if you use one, (or vice versa) and just FETCH the first row.
If you don't have an order by, consider adding one?
Chris
"Chuck Renaud" <crenaud@informix.com> on 13/10/99 20:24:20
Please respond to crenaud@informix.com
To: Wazir Shpoon <wshpoon@winstar.com>, informix-list@iiug.org
cc: (bcc: Chris West/Finance/MEDAS)
Subject: Re: Newbie question on returned rows
SELECT FIRST X isn't supported until 7.3.
As for returning the last row, you can try searching for max(rowid),
but I don't believe that'll work on a fragmented table.
> Hello all,
>
> What is the "set" statement that sets the limit of rows returned by a
> select statement. Also, what statement would return the last row?
Thanks
> in advance for your help. I am using version 7.20 on HP unix. I tried
> the
>
> select FIRST 10 *
> from table_name>
> but it didn't work. It gave syntax error. Any help is appreciated.
> Thanks
>
> -Wazir
> wshpoon@winstar.com
>
>
>
>