#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2012
    Posts
    1
    Rep Power
    0

    Problm with Mysql commands (max,sum,count)


    Hello my friends,
    I have an urgent problem with this sql command,please help me asap,
    thank you so much in advance.

    what is Mysql command for the below operation


    fields:email,text
    records:
    email address1,HI
    email addres1,BYE
    email address2,Hey

    maximum amount of messages from different email addresses: answer=2


    i'm waiting for answer friends.

    Best regards,
    iman
  2. #2
  3. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Location
    Toronto Canada
    Posts
    27,144
    Rep Power
    4274
    Code:
    SELECT email
         , COUNT(*) AS total
      FROM daTable
    GROUP
        BY email
    ORDER
        BY total DESC LIMIT 1
    also, please note i've moved your thread to the mysql forum
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

IMN logo majestic logo threadwatch logo seochat tools logo