Re: [GENERAL] Set Returning Functions and joins

2012-08-15 Thread David Greco
] Set Returning Functions and joins Inline comments: On Aug 15, 2012, at 16:24, David Greco mailto:david_gr...@harte-hanks.com>> wrote: Not sure how to write the CTE form of this. This query gives an error that dave is missing a from clause entry. WITH o as ( SELECT getRe

Re: [GENERAL] Set Returning Functions and joins

2012-08-15 Thread David Johnston
LEFT JOIN > version of this query Agreed. See above example that can handle both. > > > From: David Johnston [mailto:pol...@yahoo.com] > Sent: Wednesday, August 15, 2012 4:16 PM > To: David Greco > Cc: pgsql-general@postgresql.org > Subject: Re: [GENERAL] Set Retu

Re: [GENERAL] Set Returning Functions and joins

2012-08-15 Thread David Greco
a LEFT JOIN version of this query. From: David Johnston [mailto:pol...@yahoo.com] Sent: Wednesday, August 15, 2012 4:16 PM To: David Greco Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Set Returning Functions and joins On Aug 15, 2012, at 15:55, David Greco mailto:david_gr

Re: [GENERAL] Set Returning Functions and joins

2012-08-15 Thread David Johnston
On Aug 15, 2012, at 15:55, David Greco wrote: > I’m porting some code from an Oracle application and we have many uses of set > returning function. In particular, we are using them in joins of the form: > > CREATE TABLE dave ( id integer, field1 integer ); > INSERT INTO dave VALUES (1, 10); >

[GENERAL] Set Returning Functions and joins

2012-08-15 Thread David Greco
I'm porting some code from an Oracle application and we have many uses of set returning function. In particular, we are using them in joins of the form: CREATE TABLE dave ( id integer, field1 integer ); INSERT INTO dave VALUES (1, 10); SELECT id, g.* FROM dave