List:General Discussion« Previous MessageNext Message »
From:Michael Dykman Date:November 8 2009 3:35pm
Subject:Re: Finding users who haven't posted in a week
View as plain text  
the function max(), among others, makes no sense in the absence of a
GROUP BY clause.

try adding "GROUP BY user_id"

 - michael dykman

On Sun, Nov 8, 2009 at 9:40 AM, John Meyer
<johnmeyer@stripped> wrote:
> I want to get a list of all users who haven't posted in a week. But when I
> use the following function.
>
>
>
> select user_id, max(tweet_createdat) from tweets where
> datediff(now(),max(tweet_createdat)) > 7;
>
>
>
>
>
> Is producing the error:
>
>
>
> Invalid use of group function
>
>
>
>
>
>



-- 
 - michael dykman
 - mdykman@stripped

"May you live every day of your life."
    Jonathan Swift

Larry's First Law of Language Redesign: Everyone wants the colon.
Thread
Finding users who haven't posted in a weekJohn Meyer8 Nov
  • Re: Finding users who haven't posted in a weekMichael Dykman8 Nov
    • RE: Finding users who haven't posted in a weekJohn Meyer8 Nov
      • RE: Finding users who haven't posted in a weekJohn Meyer8 Nov
        • RE: Finding users who haven't posted in a weekmos9 Nov
          • Re: Finding users who haven't posted in a weekAnanda Kumar10 Nov
          • Re: Finding users who haven't posted in a weekJohnny Withers10 Nov