[SQL] Function returning setof taking parameters from another table

2008-07-31 Thread Marcin Stępnicki
Hello. I've got a function which returns set of records: select * from f_test(123); param | val1 | val2 --- 123 | 1 | 17 123 | 2 | 18 I'd like to execute it multiple times with parameters from other query, like (it doesn't work of course): select *

Re: [SQL] Problem with ORDER BY and DISTINCT ON

2008-07-31 Thread Tom Lane
Steve Midgley <[EMAIL PROTECTED]> writes: > At 07:29 AM 7/16/2008, Tom Lane wrote: >> I think what is happening is that ORDER BY knows that and gets rid of >> the duplicate entries while DISTINCT ON fails to do so. > Of course removing the duplicate from both areas is the correct > solution and I

Re: [SQL] Problem with ORDER BY and DISTINCT ON

2008-07-31 Thread Steve Midgley
At 03:51 PM 7/31/2008, Tom Lane wrote: Steve Midgley <[EMAIL PROTECTED]> writes: > At 07:29 AM 7/16/2008, Tom Lane wrote: >> I think what is happening is that ORDER BY knows that and gets rid of >> the duplicate entries while DISTINCT ON fails to do so. > Of course removing the duplicate from