Cc: mysql@lists.mysql.com
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
>-Original Message-
>From: Gavin Towey [mailto:gto...@ffn.com]
>Sent: Wednesday, September 16, 2009 7:34 PM
>To: John Meyer; mysql@lists.mysql.com
>Subject: RE: Datediff function
>
>Hi John,
>
>You can't use aggregate function in the WHERE clause, because th
John Meyer wrote:
I'm trying to pull up a list of users who haven't tweeted in 7 or more
days, and I'm trying to use this statement:
SELECT USER_NAME, MAX(TWEET_CREATEDAT) FROM USERS NATURAL JOIN TWEETS
WHERE DATEDIFF(NOW(),MAX(TWEET_CREATEDAT)) > 7
But it says "invalid group function". How
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_tw
weet_date < NOW()-INTERVAL 7 DAY; ?
Regards,
Gavin Towey
-Original Message-
From: John Meyer [mailto:johnme...@pueblocomputing.com]
Sent: Wednesday, September 16, 2009 12:52 PM
To: mysql@lists.mysql.com
Subject: Datediff function
I'm trying to pull up a list of users who haven't tw
I'm trying to pull up a list of users who haven't tweeted in 7 or more
days, and I'm trying to use this statement:
SELECT USER_NAME, MAX(TWEET_CREATEDAT) FROM USERS NATURAL JOIN TWEETS
WHERE DATEDIFF(NOW(),MAX(TWEET_CREATEDAT)) > 7 GROUP BY USERS.USER_ID
But it says "invalid group function". H
beginner with MySql and i can't see the way to do this function
>> .. How can I extract for example difference of hours between two given
>> dates .. someone help me please ?
>>
>> Thanks in advance
>
> Not quite sure what it means to get the difference betwe
can I extract for example difference of hours between two given dates ..
someone help me please ?
Thanks in advance
Not quite sure what it means to get the difference between two dates in
months or hours, but mysql does have a DATEDIFF function:
DATEDIFF(expr,expr2)
DATEDIFF() returns the number of
I am a user of Microsoft Sql Server and use very much the function Datediff
(interval, fecha1, fecha2) to extract differences between two dates, in
years, days, months, hours, etc
I am a beginner with MySql and i can't see the way to do this function ..
How can I extract for example difference of