Received: from thelab.hub.org (nat200.60.mpoweredpc.net [142.177.200.60]) by hub.org (8.9.3/8.9.3) with ESMTP id CAA78914 for ; Sat, 8 Jan 2000 02:03:12 -0500 (EST) (envelope-from scrappy@hub.org) Received: from localhost (scrappy@localhost) by thelab.hub.org (8.9.3/8.9.1) with ESMTP id DAA12420 for ; Sat, 8 Jan 2000 03:03:16 -0400 (AST) (envelope-from scrappy@hub.org) X-Authentication-Warning: thelab.hub.org: scrappy owned process doing -bs Date: Sat, 8 Jan 2000 03:03:16 -0400 (AST) From: The Hermit Hacker To: pgsql-sql@postgresql.org Subject: Could this be done better...? Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII SELECT status,sum(case when next_index_time<=%d then 1 else 0 end),count(*) FROM url WHERE 1=1 %s%s%s GROUP BY status; There may not be enough info here to answer, but the 'case/then/else/end' just looks weird to me... Marc G. Fournier ICQ#7615664 IRC Nick: Scrappy Systems Administrator @ hub.org primary: scrappy@hub.org secondary: scrappy@{freebsd|postgresql}.org