pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pagination problem in postgresql need help
3+ messages / 3 participants
[nested] [flat]

* pagination problem in postgresql need help
@ 2011-06-17 22:43 hatem gamal elzanaty <hatem@softpro.bz>
  2011-06-19 08:37 ` Re: pagination problem in postgresql need help Jasen Betts <jasen@xnet.co.nz>
  0 siblings, 1 reply; 3+ messages in thread

From: hatem gamal elzanaty @ 2011-06-17 22:43 UTC (permalink / raw)
  To: pgsql-sql

hi,
please see this code

select aiah_number.aiah_number_id, aiah_number.aiah_number, 
lock.lock_status, rank.rank_value, approve.approve_status, lock.view 
from aiah_number inner join lock on aiah_number.locked = lock.lock_id 
inner join rank on aiah_number.rank = rank.rank_id inner join approve on 
aiah_number.approve = approve.approve_id order by rank_value desc limit 
1 offset 0;

and this code

select aiah_number.aiah_number_id, aiah_number.aiah_number, 
lock.lock_status, rank.rank_value, approve.approve_status, lock.view 
from aiah_number inner join lock on aiah_number.locked = lock.lock_id 
inner join rank on aiah_number.rank = rank.rank_id inner join approve on 
aiah_number.approve = approve.approve_id order by rank_value desc limit 
1 offset 1;

suppose i have 200 hundred record and i want to display records in pages 
one record per page i'm facing a problem even if i'm running the script 
through phppgadmin it's only display the first record in the page only 
no more no less in the php code it display record 1 and records byound 
180 and so on

can you help in that issue ?

thanks in advance



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: pagination problem in postgresql need help
  2011-06-17 22:43 pagination problem in postgresql need help hatem gamal elzanaty <hatem@softpro.bz>
@ 2011-06-19 08:37 ` Jasen Betts <jasen@xnet.co.nz>
  2011-06-20 13:29   ` Re: pagination problem in postgresql need help Emi Lu <emilu@encs.concordia.ca>
  0 siblings, 1 reply; 3+ messages in thread

From: Jasen Betts @ 2011-06-19 08:37 UTC (permalink / raw)
  To: pgsql-sql

On 2011-06-17, hatem gamal elzanaty <hatem@softpro.bz> wrote:
> hi,
> please see this code
>
> select aiah_number.aiah_number_id, aiah_number.aiah_number, 
...
> order by rank_value desc limit 1 offset 0;
>
> and this code
>
> select aiah_number.aiah_number_id, aiah_number.aiah_number, 
...
> order by rank_value desc limit 1 offset 1;

> suppose i have 200 hundred record and i want to display records in pages 
> one record per page i'm facing a problem even if i'm running the script 
> through phppgadmin it's only display the first record in the page only 
> no more no less in the php code it display record 1 and records byound 
> 180 and so on
>
> can you help in that issue ?

check that the PHP query is actualy what you think it is.

-- 
⚂⚃ 100% natural




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: pagination problem in postgresql need help
  2011-06-17 22:43 pagination problem in postgresql need help hatem gamal elzanaty <hatem@softpro.bz>
  2011-06-19 08:37 ` Re: pagination problem in postgresql need help Jasen Betts <jasen@xnet.co.nz>
@ 2011-06-20 13:29   ` Emi Lu <emilu@encs.concordia.ca>
  0 siblings, 0 replies; 3+ messages in thread

From: Emi Lu @ 2011-06-20 13:29 UTC (permalink / raw)
  To: Jasen Betts <jasen@xnet.co.nz>; +Cc: pgsql-sql

>> select aiah_number.aiah_number_id, aiah_number.aiah_number,
> ...
>> order by rank_value desc limit 1 offset 1;

I use:
==================
   select ...
   order by ...
   LIMIT #{pageSize}::INTEGER OFFSET #{offset}::INTEGER;

Emi





^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2011-06-20 13:29 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-06-17 22:43 pagination problem in postgresql need help hatem gamal elzanaty <hatem@softpro.bz>
2011-06-19 08:37 ` Jasen Betts <jasen@xnet.co.nz>
2011-06-20 13:29   ` Emi Lu <emilu@encs.concordia.ca>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox