If judicious transformation of data makes it easier to do the queries you want, then you
should consider it. ETL isn't a common acronym in the database world just because we like
three letters =) Though it depends on how often you're doing this, if it's one-off then
it's probably not worth it, though I was making the assumption you're probably going to be
using that query frequently.
From: John Meyer [mailto:johnmeyer@stripped]
Sent: Wednesday, September 16, 2009 4:51 PM
To: Gavin Towey
Subject: Re: Datediff function
Gavin Towey wrote:
> Hi John,
> You can't use aggregate function in the WHERE clause, because they aren't evaluated
> until after the WHERE clause is applied.
> Wouldn't it be much easier to simply keep a last_tweet_date field updated somewhere
> then simply do
> SELECT USER_NAME FROM USERS WHERE last_tweet_date < NOW()-INTERVAL 7 DAY; ?
> Gavin Towey
I don't know if that would be so simple. I'd have to run programming
logic when I fetch the information off the twitter server. I just hoped
that there was a way to do it through SQL.
The information contained in this transmission may contain privileged and confidential
information. It is intended only for the use of the person(s) named above. If you are not
the intended recipient, you are hereby notified that any review, dissemination,
distribution or duplication of this communication is strictly prohibited. If you are not
the intended recipient, please contact the sender by reply email and destroy all copies of
the original message.