pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Getting data where select has a limit criteria
3+ messages / 2 participants
[nested] [flat]

* Getting data where select has a limit criteria
@ 2006-01-12 15:48  Kashyap Jani <kjani@cognitronics.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Kashyap Jani @ 2006-01-12 15:48 UTC (permalink / raw)
  To: pgsql-interfaces

Hi,
    I am trying to issue a query like "SELECT * from <some table> limit 
30". In psql command line interface it displays only 30 rows at a time. 
How will it behave if I use libpq. Is it going to return me only 30 rows ?


Regards,
Kashyap Jani





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

* Re: Getting data where select has a limit criteria
@ 2006-01-12 20:03  Michael Fuhr <mike@fuhr.org>
  parent: Kashyap Jani <kjani@cognitronics.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Michael Fuhr @ 2006-01-12 20:03 UTC (permalink / raw)
  To: Kashyap Jani <kjani@cognitronics.com>; +Cc: pgsql-interfaces

On Thu, Jan 12, 2006 at 10:48:08AM -0500, Kashyap Jani wrote:
>    I am trying to issue a query like "SELECT * from <some table> limit 
> 30". In psql command line interface it displays only 30 rows at a time. 

With LIMIT 30 psql should display only 30 rows altogether ("30 rows
at a time" suggests that you're getting more than 30 rows -- are
you?).

> How will it behave if I use libpq. Is it going to return me only 30 rows ?

If you put LIMIT 30 in the query then you should get at most 30
rows.  What happened when you tried it?

-- 
Michael Fuhr



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

* Re: Getting data where select has a limit criteria
@ 2006-01-12 23:18  Kashyap Jani <kjani@cognitronics.com>
  parent: Michael Fuhr <mike@fuhr.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Kashyap Jani @ 2006-01-12 23:18 UTC (permalink / raw)
  To: Michael Fuhr <mike@fuhr.org>; +Cc: pgsql-interfaces

Michael Fuhr wrote:

>On Thu, Jan 12, 2006 at 10:48:08AM -0500, Kashyap Jani wrote:
>  
>
>>   I am trying to issue a query like "SELECT * from <some table> limit 
>>30". In psql command line interface it displays only 30 rows at a time. 
>>    
>>
>
>With LIMIT 30 psql should display only 30 rows altogether ("30 rows
>at a time" suggests that you're getting more than 30 rows -- are
>you?).
>
>  
>
>>How will it behave if I use libpq. Is it going to return me only 30 rows ?
>>    
>>
>
>If you put LIMIT 30 in the query then you should get at most 30
>rows.  What happened when you tried it?
>
>  
>
Thanks Michael,
    I returned 30 records back. I wasn't sure how it will work and 
thought I could just ask instead of actually writing a sample test 
program... But I ended up witting a sample program anyway..

Regards,
Kashyap




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


end of thread, other threads:[~2006-01-12 23:18 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-01-12 15:48 Getting data where select has a limit criteria Kashyap Jani <kjani@cognitronics.com>
2006-01-12 20:03 ` Michael Fuhr <mike@fuhr.org>
2006-01-12 23:18   ` Kashyap Jani <kjani@cognitronics.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