X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 5CEB5D1B561 for ; Tue, 4 Nov 2003 15:06:59 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 12563-06 for ; Tue, 4 Nov 2003 11:06:32 -0400 (AST) Received: from main.gmane.org (main.gmane.org [80.91.224.249]) by svr1.postgresql.org (Postfix) with ESMTP id 976BBD1CB0E for ; Tue, 4 Nov 2003 11:06:28 -0400 (AST) Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1AH2lM-0000mC-00 for ; Tue, 04 Nov 2003 16:06:32 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-sql@postgresql.org Received: from sea.gmane.org ([80.91.224.252]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AH2lL-0000m4-00 for ; Tue, 04 Nov 2003 16:06:31 +0100 Received: from news by sea.gmane.org with local (Exim 3.35 #1 (Debian)) id 1AH2lL-0005T2-00 for ; Tue, 04 Nov 2003 16:06:31 +0100 From: Paul Ganainm Subject: Re: Using UNION inside a cursor Date: Tue, 4 Nov 2003 15:02:57 -0000 Organization: Néant Lines: 27 Message-ID: References: <007c01c39ec4$5af992f0$7502a8c0@hdsc.com> X-Complaints-To: usenet@sea.gmane.org X-Newsreader: MicroPlanet Gravity v2.50 X-Virus-Scanned: by amavisd-new at postgresql.org X-Amavis-Alert: BAD HEADER Non-encoded 8-bit data (char E9 hex) in message header 'Organization' Organization: N\351ant\n ^ X-Archive-Number: 200311/15 X-Sequence-Number: 15830 sgnerd@yahoo.com.sg says... > (SELECT * FROM history WHERE obs_type = \'AA\' ) > UNION > (SELECT * FROM history WHERE obs_type = \'TA\'); Maybe I'm just confused here, but what's to stop you using SELECT * FROM History WHERE (Obs_Type = \'AA\' AND Obs_Type = \'TA\') ? Or have I missed something really obvious? Paul... -- plinehan__AT__yahoo__DOT__com C++ Builder 5 SP1, Interbase 6.0.1.6 IBX 5.04 W2K Pro Please do not top-post.