Re: [GENERAL] Using the query INTERSECTion

2007-06-18 Thread Tom Lane
Vincenzo Romano <[EMAIL PROTECTED]> writes: > But now I have one more thing. The following command will fail with > a syntax error: > SELECT * FROM (SELECT 1 ) a INTERSECT (SELECT 2 ) b; > Because of the second (harmless) table alias. > In my mind it should work. Or not? Not. INTERSECT is not l

Re: [GENERAL] Using the query INTERSECTion

2007-06-18 Thread Vincenzo Romano
On Monday 18 June 2007 19:27:35 Martijn van Oosterhout wrote: > On Mon, Jun 18, 2007 at 04:10:41PM +0200, Vincenzo Romano wrote: > > Hello everyone. > > > > In order to build some dynamic queries (EXECUTE under PL/PgSQL) > > I'm taking in consideration to use the INTERSECT operator in > > order to

Re: [GENERAL] Using the query INTERSECTion

2007-06-18 Thread Martijn van Oosterhout
On Mon, Jun 18, 2007 at 04:10:41PM +0200, Vincenzo Romano wrote: > Hello everyone. > > In order to build some dynamic queries (EXECUTE under PL/PgSQL) > I'm taking in consideration to use the INTERSECT operator in order > to split a WHERE-condition in a static one and a dynamic one to be > built a

[GENERAL] Using the query INTERSECTion

2007-06-18 Thread Vincenzo Romano
Hello everyone. In order to build some dynamic queries (EXECUTE under PL/PgSQL) I'm taking in consideration to use the INTERSECT operator in order to split a WHERE-condition in a static one and a dynamic one to be built at runtime. Instead of SELECT * FROM joinedtables WHERE static_cond AND dyna