How can i count the emaiid in my table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sang
    New Member
    • Sep 2006
    • 83

    How can i count the emaiid in my table

    Hi
    I had a table with the Emailid, i want to count the particular domain in the Field Emailid.

    For Example
    Code:
    Table User_account;
    
    Emailid   Id
    qqq@yahoo.com 1
    eee@rediff.com   2
    jjjjj@yahoo.com  3
    I want to count domains
    Code:
    Emailid       count
    yahoo.com    2
    rediff.com      1
    Please give me the query to count that

    Thanks in advance
    Sang
  • ScarletPimpernal
    New Member
    • Mar 2007
    • 39

    #2
    Hi,

    Its so simple,try this query

    SELECT Emailid,COUNT(E mailid) FROM User_account GROUP BY Emailid;

    Thanks,
    Scarlet




    Originally posted by sang
    Hi
    I had a table with the Emailid, i want to count the particular domain in the Field Emailid.

    For Example
    Code:
    Table User_account;
    
    Emailid   Id
    qqq@yahoo.com 1
    eee@rediff.com   2
    jjjjj@yahoo.com  3
    I want to count domains
    Code:
    Emailid       count
    yahoo.com    2
    rediff.com      1
    Please give me the query to count that

    Thanks in advance
    Sang

    Comment

    • sang
      New Member
      • Sep 2006
      • 83

      #3
      Originally posted by ScarletPimperna l
      Hi,

      Its so simple,try this query

      SELECT Emailid,COUNT(E mailid) FROM User_account GROUP BY Emailid;

      Thanks,
      Scarlet
      This is already i done. but i want to print the count of domain names. i done that also (ie)
      Code:
       Select substring_index(emailid,'@',-1)as domain,count(Emailid) from User_
      account group by domain;
      Thank you for your reply
      Sang

      Comment

      Working...