pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Re: [INTERFACES] limiting the rows selected in postgresql
5+ messages / 5 participants
[nested] [flat]

* Re: [INTERFACES] limiting the rows selected in postgresql
@ 1998-11-07 16:39  Sergio <ser@perio.unlp.edu.ar>
  parent: Sferacarta Software <sferac@bo.nettuno.it>
  0 siblings, 2 replies; 5+ messages in thread

From: Sergio @ 1998-11-07 16:39 UTC (permalink / raw)
  To: pgsql-interfaces

Sferacarta Software <sferac@bo.nettuno.it> el día Mon, 9 Nov 1998 14:33:06 
+0100, escribió:

>Hello Radhakrishnan,
>
>lunedì, 9 novembre 98, you wrote:
>
>
>RCV> how can i limit the number of rows obtained from a select statement
>RCV> in postgreSQL to say, 10 rows while the select condition  actually
>RCV> matches more than that. in oracle we can use the ROW_NUM variable
>RCV> for this purpose but now i met such an issue with postgreSQL
>
>On v6.4 you can specify a limit for queries as:
>
>set QUERY_LIMIT TO '10';
>To have only the first 10 rows from a select;

this will limit _all_ the querys, right ?
wich is not very flexible.

I can't do something like

select * from news order by news_date limit 10

?

Sergio




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

* limiting the rows selected in postgresql
@ 1998-11-09 12:52  RADHAKRISHNAN C V <cvr@md2.vsnl.net.in>
  0 siblings, 1 reply; 5+ messages in thread

From: RADHAKRISHNAN C V @ 1998-11-09 12:52 UTC (permalink / raw)
  To: pgsql-interfaces


how can i limit the number of rows obtained from a select statement
in postgreSQL to say, 10 rows while the select condition  actually
matches more than that. in oracle we can use the ROW_NUM variable
for this purpose but now i met such an issue with postgreSQL

thanks in advance

CV Radhakrishnan

http://www.river-valley.com




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

* Re: [INTERFACES] limiting the rows selected in postgresql
@ 1998-11-09 13:33  Sferacarta Software <sferac@bo.nettuno.it>
  parent: RADHAKRISHNAN C V <cvr@md2.vsnl.net.in>
  0 siblings, 1 reply; 5+ messages in thread

From: Sferacarta Software @ 1998-11-09 13:33 UTC (permalink / raw)
  To: pgsql-interfaces@postgresql.org, RADHAKRISHNAN C V <cvr@md2.vsnl.net.in>

Hello Radhakrishnan,

lunedì, 9 novembre 98, you wrote:


RCV> how can i limit the number of rows obtained from a select statement
RCV> in postgreSQL to say, 10 rows while the select condition  actually
RCV> matches more than that. in oracle we can use the ROW_NUM variable
RCV> for this purpose but now i met such an issue with postgreSQL

On v6.4 you can specify a limit for queries as:

set QUERY_LIMIT TO '10';
To have only the first 10 rows from a select;

-Jose'-





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

* Re: [INTERFACES] limiting the rows selected in postgresql
@ 1998-11-09 20:27  Oleg Bartunov <oleg@sai.msu.su>
  parent: Sergio <ser@perio.unlp.edu.ar>
  1 sibling, 0 replies; 5+ messages in thread

From: Oleg Bartunov @ 1998-11-09 20:27 UTC (permalink / raw)
  To: Sergio <ser@perio.unlp.edu.ar>; +Cc: pgsql-interfaces

On Sat, 7 Nov 1998, Sergio wrote:

> Date: Sat, 7 Nov 1998 13:39:27 -0300
> From: Sergio <ser@perio.unlp.edu.ar>
> To: pgsql-interfaces@postgreSQL.org
> Subject: Re: [INTERFACES] limiting the rows selected in postgresql
> 
> Sferacarta Software <sferac@bo.nettuno.it> el dМa Mon, 9 Nov 1998 14:33:06 
> +0100, escribiС:
> 
> >Hello Radhakrishnan,
> >
> >lunedЛ, 9 novembre 98, you wrote:
> >
> >
> >RCV> how can i limit the number of rows obtained from a select statement
> >RCV> in postgreSQL to say, 10 rows while the select condition  actually
> >RCV> matches more than that. in oracle we can use the ROW_NUM variable
> >RCV> for this purpose but now i met such an issue with postgreSQL
> >
> >On v6.4 you can specify a limit for queries as:
> >
> >set QUERY_LIMIT TO '10';
> >To have only the first 10 rows from a select;
> 
> this will limit _all_ the querys, right ?
> wich is not very flexible.
> 
> I can't do something like
> 
> select * from news order by news_date limit 10
> 
> ?

Sergio,

be patient. Jan Wieck is working on patch for support LIMIT in select query.
I'm using his patch (trial 2) with 6.4 and it works great for me.
With this patch you can limit output using LIMIT offset,count statement.
Hope, this patch will come to 6.4.1.

	Regards,

		Oleg

PS. Browse hackers mailing list for last month to read discussion on
    this subject.
> 
> Sergio
> 
> 

_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83





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

* Re: [INTERFACES] limiting the rows selected in postgresql
@ 1998-11-09 22:06  A James Lewis <james@vrtx.net>
  parent: Sergio <ser@perio.unlp.edu.ar>
  1 sibling, 0 replies; 5+ messages in thread

From: A James Lewis @ 1998-11-09 22:06 UTC (permalink / raw)
  To: Sergio <ser@perio.unlp.edu.ar>; +Cc: pgsql-interfaces


I did this with:-

declare tmp cursor for select * from table;fetch forward 10 in tmp;

But if someone else has a better way, please let me know....

On Sat, 7 Nov 1998, Sergio wrote:

> Sferacarta Software <sferac@bo.nettuno.it> el día Mon, 9 Nov 1998 14:33:06 
> +0100, escribió:
> 
> >Hello Radhakrishnan,
> >
> >lunedì, 9 novembre 98, you wrote:
> >
> >
> >RCV> how can i limit the number of rows obtained from a select statement
> >RCV> in postgreSQL to say, 10 rows while the select condition  actually
> >RCV> matches more than that. in oracle we can use the ROW_NUM variable
> >RCV> for this purpose but now i met such an issue with postgreSQL
> >
> >On v6.4 you can specify a limit for queries as:
> >
> >set QUERY_LIMIT TO '10';
> >To have only the first 10 rows from a select;
> 
> this will limit _all_ the querys, right ?
> wich is not very flexible.
> 
> I can't do something like
> 
> select * from news order by news_date limit 10
> 
> ?
> 
> Sergio
> 
> 

James (james@linuxrocks.co.uk)
Vortex Internet
My Windows unders~1 long filena~1, and yours?




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


end of thread, other threads:[~1998-11-09 22:06 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1998-11-09 12:52 limiting the rows selected in postgresql RADHAKRISHNAN C V <cvr@md2.vsnl.net.in>
1998-11-09 13:33 ` Sferacarta Software <sferac@bo.nettuno.it>
1998-11-07 16:39   ` Sergio <ser@perio.unlp.edu.ar>
1998-11-09 20:27     ` Oleg Bartunov <oleg@sai.msu.su>
1998-11-09 22:06     ` A James Lewis <james@vrtx.net>

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