From: | Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> |
---|---|
To: | Dave Potts <dave(dot)potts(at)pinan(dot)co(dot)uk>, pgsql-general(at)postgresql(dot)org |
Subject: | Re: returning only part of a rule set |
Date: | 2014-11-25 22:11:35 |
Message-ID: | 5474FE97.6090306@aklaver.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On 11/25/2014 01:56 PM, Dave Potts wrote:
> On 25/11/14 21:36, Adrian Klaver wrote:
>> On 11/25/2014 01:27 PM, Dave Potts wrote:
>>> I have a psql function that make a general sql query, returns a set of
>>> results
>>>
>>>
>>> Q. Is there anyway that I can limit the size of the result sets ?
>>
>> Put a LIMIT on the query.
>>
>> If that is not what you want then we will need to see the code and/or
>> get a more detailed explanation of where you want the limiting to occur.
> I tried that Limit applies to the total number of results from a
> query, what I want to do is limit the total number of returns per
> result set,
>
> For example if my query returns a set of items such as id, foo,bar
>
> Normally the result set is 3 set of records one with 3 entries, one with
> 2 entires and one with entry, the results would be.
>
> 1 xx,yy
> 2 xx,yy
> 3 xx,yy
>
> 1,dd,zz
> 2,dd,zz
>
> 1, ee,ff
So you are selecting on foo and bar?
>
> If I am only interested in get 2 entries per result set, I would expect
> to see
Actually <=2.
How do you determine which rows to keep, by id or something else?
>
> 1 xx,yy
> 2 xx,yy
>
>
> 1,dd,zz
> 2,dd,zz
>
> 1, ee,ff
>
> Using LIMIT only gives
> 1 xx,yy
> 2 xx,yy
>
> Sorry for not explaining it very, I want to limit the size of an
> inviduail set of records which is part of set of records.
It would help if we could see the actual query you are using to get the
result sets, suitably anonymized if needed.
>
>
>
>
>>
>>>
>>> Dave.
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>
>
>
--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com
From | Date | Subject | |
---|---|---|---|
Next Message | David G Johnston | 2014-11-25 22:24:57 | Re: returning only part of a rule set |
Previous Message | Dave Potts | 2014-11-25 21:56:18 | Re: returning only part of a rule set |