solution as suggested
here.
Regards
GMB
--
View this message in context:
http://postgresql.1045698.n5.nabble.com/Help-needed-with-Window-function-tp5773160p5773196.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.
--
Sent via pgsql-sql mailing list (pgsql-sql@po
>> The best, which you won't
>> like, is to wait for 9.4 where unnest() will most likely have a WITH
>> ORDINALITY option and you can sort on that.
The fact that this type of thing is on the 9.4 roadmap indicates (to me, in
any case) that there are problems with the UNNEST functionality in the
>> An array is ordered. If you turn it into a relation then it isn't
>> ordered any more until you apply ORDER BY.
>>
>> An unnest() will almost certainly scan the array in-order, but once you
>> embed that in a large query the ordering is no longer guaranteed.
Thanks, I assumed as much. Apprec
Hi Vik
Thanks for the reply.
Can you please give me an example of how the order is specified?
I want the result of the UNNEST to be in the order of the array field
E.g.
SELECT UNNEST ( ARRAY[ 'abc' , 'ggh' , '12aa' , '444f' ] );
Should always return:
unnest
abc
ggh
12aa
444f
How sh
Hi all
I just want to confirm something regarding UNNEST function used with arrays.
I cannot see that it is specifically mentioned in the documentation , but
maybe because it is obvious.
Is the order of the result guaranteed to be the order of the array
I.e. is it possible that:
SELECT UNNEST( AR
Pavel Stehule wrote:
>
>
> npcps_201=# select * from (select 1,2,2,3) x (a,b,c,d);
>
>
That is a neat trick - one I didn't know of.
Thanks Pavel
--
View this message in context:
http://postgresql.1045698.n5.nabble.com/Usage-of-function-retruning-record-in-query-tp4549140p4552618.html
Sent
gmb wrote:
>
>
> Thanks for the feedback, Harald.
>
> How about specifying different aliases to the resulting values?
> This will be handy when I use the same function multiple times in the same
> query.
> (the function will take another input parameters used in th
Harald Fuchs-10 wrote:
> In article <1309762075448-4549140.p...@n5.nabble.com>,gmb
> <gmbou...@gmail.com> writes:
> SELECT itemid, (calcvalues(itemid)).* FROM itemlist
>
Thanks for the feedback, Harald.
How about specifying different aliases to the resulting values?
T
Hi
I have a stored function returning a record consisting of two field, and
receiving as input a single identifier:
CREATE FUNCTION calcvalues(IN itemid VACHAR, OUT calcval1 NUMERIC, OUT
calcval2 NUMERIC)
RETURNS record...
Now, I want to use this function in a query as follows:
SELECT itemid, c