On Thu, Jul 8, 2010 at 9:09 PM, Kenichiro Tanaka
wrote:
> Hello.
>
> I agree Ben.
> But,I try your question as an SQL puzzle.
> Doses this SQL meet what you want?
>
> select * from wantlast offset (select count(*)-10 from wantlast);
that works, but for any non trivial query it's not optimal becau
Hello.
I agree Ben.
But,I try your question as an SQL puzzle.
Doses this SQL meet what you want?
select * from wantlast offset (select count(*)-10 from wantlast);
--test case
create table wantlast(col1 int);
insert into wantlast select g from generate_series(1,1000) as g;
postgres=# select * f
On Jul 8, 2010, at 4:17 PM, Edmundo Robles L. wrote:
> Hi!
>
> if a want the first 5,10,N tuples of a query (even without order)
> i just have to do a:
> select * from table limit 10;
That does not get the first 10 tuples, it merely gets 10 tuples. The database
is free to return whiche
Hi!
if a want the first 5,10,N tuples of a query (even without order)
i just have to do a:
select * from table limit 10;
but, What can i do to get the last 10 tuples ???
i try to do:
select * from table limit -10; :-D but that query return 0 tuples .
So, what is the right way to