Re: - Mailing list pgsql-sql

From Dan Langille
Subject Re:
Date
Msg-id 3F786988.30024.356FBB90@localhost
Whole thread Raw
In response to Re:  (Jean-Luc Lachance <jllachan@nsd.ca>)
List pgsql-sql
On 29 Sep 2003 at 10:04, Jean-Luc Lachance wrote:

> Wouldn't:
> 
> insert into r 
> select count(*) 
> from users 
> where date( lastlogin) > current_date - MaxDays * interval '' 1 day''
> group by date( lastlogin);
> 
> be more efficient?


Yes it would, by a factor of 5.

P.S. but it would not show dates for which there are no logins.  The 
above can return zero rows.  The previous example always returns 
MaxDays rows.
-- 
Dan Langille : http://www.langille.org/



pgsql-sql by date:

Previous
From: Franco Bruno Borghesi
Date:
Subject: Re: Help with pivoting tables
Next
From: "David B"
Date:
Subject: How to figure out when was a table created