pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
restircting rows
4+ messages / 4 participants
[nested] [flat]

* restircting rows
@ 2006-02-22 09:06 padmanabha konkodi <konkodi221@rediffmail.com>
  2006-02-22 09:18 ` Re: restircting rows Richard Huxton <dev@archonet.com>
  2006-02-22 09:19 ` Re: restircting rows A. Kretschmer <andreas.kretschmer@schollglas.com>
  2006-02-22 09:23 ` Re: restircting rows Michael Glaesemann <grzm@myrealbox.com>
  0 siblings, 3 replies; 4+ messages in thread

From: padmanabha konkodi @ 2006-02-22 09:06 UTC (permalink / raw)
  To: pgsql-sql

  
  
hi all,

my query return 100 rows but if i am intrested only from 40-60 rows then how to restrict.

for example

select * from students (returns 100 rows).but i am intrested only rows from 40 to 60.

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

* Re: restircting rows
  2006-02-22 09:06 restircting rows padmanabha konkodi <konkodi221@rediffmail.com>
@ 2006-02-22 09:18 ` Richard Huxton <dev@archonet.com>
  2 siblings, 0 replies; 4+ messages in thread

From: Richard Huxton @ 2006-02-22 09:18 UTC (permalink / raw)
  To: padmanabha konkodi <konkodi221@rediffmail.com>; +Cc: pgsql-sql

padmanabha konkodi wrote:
> 
> 
> hi all,
> 
> my query return 100 rows but if i am intrested only from 40-60 rows
> then how to restrict.
> 
> for example
> 
> select * from students (returns 100 rows).but i am intrested only
> rows from 40 to 60.

SELECT * FROM student ORDER BY something LIMIT 20 OFFSET 40;

Be aware that this will have to fetch 60 rows and throw the first 40 away.


-- 
   Richard Huxton
   Archonet Ltd



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

* Re: restircting rows
  2006-02-22 09:06 restircting rows padmanabha konkodi <konkodi221@rediffmail.com>
@ 2006-02-22 09:19 ` A. Kretschmer <andreas.kretschmer@schollglas.com>
  2 siblings, 0 replies; 4+ messages in thread

From: A. Kretschmer @ 2006-02-22 09:19 UTC (permalink / raw)
  To: pgsql-sql

am  22.02.2006, um  9:06:57 -0000 mailte padmanabha konkodi folgendes:
>   
>   
> hi all,
> 
> my query return 100 rows but if i am intrested only from 40-60 rows then how to restrict.
> 
> for example
> 
> select * from students (returns 100 rows).but i am intrested only rows from 40 to 60.

select * from students limit 20 offset 40;


HTH, Andreas
-- 
Andreas Kretschmer    (Kontakt: siehe Header)
Heynitz:  035242/47215,      D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
 ===    Schollglas Unternehmensgruppe    === 



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

* Re: restircting rows
  2006-02-22 09:06 restircting rows padmanabha konkodi <konkodi221@rediffmail.com>
@ 2006-02-22 09:23 ` Michael Glaesemann <grzm@myrealbox.com>
  2 siblings, 0 replies; 4+ messages in thread

From: Michael Glaesemann @ 2006-02-22 09:23 UTC (permalink / raw)
  To: padmanabha konkodi <konkodi221@rediffmail.com>; +Cc: pgsql-sql


On Feb 22, 2006, at 18:06 , padmanabha konkodi wrote:
> my query return 100 rows but if i am intrested only from 40-60 rows  
> then how to restrict.
>
> for example
>
> select * from students (returns 100 rows).but i am intrested only  
> rows from 40 to 60.

See LIMIT and OFFSET.
http://www.postgresql.org/docs/8.1/interactive/sql-select.html#SQL-LIMIT

Michael Glaesemann
grzm myrealbox com






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


end of thread, other threads:[~2006-02-22 09:23 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-02-22 09:06 restircting rows padmanabha konkodi <konkodi221@rediffmail.com>
2006-02-22 09:18 ` Richard Huxton <dev@archonet.com>
2006-02-22 09:19 ` A. Kretschmer <andreas.kretschmer@schollglas.com>
2006-02-22 09:23 ` Michael Glaesemann <grzm@myrealbox.com>

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