Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id 63032476192 for ; Tue, 12 Mar 2002 13:23:38 -0500 (EST) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 25D4CD5F7; Tue, 12 Mar 2002 10:23:38 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 174FE5BFD; Tue, 12 Mar 2002 10:23:38 -0800 (PST) Date: Tue, 12 Mar 2002 10:23:38 -0800 (PST) From: Stephan Szabo To: Gary Stainburn Cc: Ian Barwick , pgsql-sql Subject: Re: in-date news items In-Reply-To: Message-ID: <20020312102311.K65916-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200203/123 X-Sequence-Number: 7003 > Thanks for that Ian, worked a treat. However, can someone tell me why > > select n.ntimestamp, n.nmid from news n where n.ntimestamp > current_time - > interval '5 minutes'; > > works while > > select n.ntimestamp, n.nmid, m.mfname, m.mlname > from news n, members m > order by ntimestamp desc > limit 1 > where (n.nmid = m.mid) and > (n.ntimestamp > current_time - interval '5 minutes'); > > has a parse error at or near "where" The where clause should go between the from and order by.