473,385 Members | 1,582 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How can i count the emaiid in my table

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

For Example
Expand|Select|Wrap|Line Numbers
  1. Table User_account;
  2.  
  3. Emailid   Id
  4. qqq@yahoo.com 1
  5. eee@rediff.com   2
  6. jjjjj@yahoo.com  3
  7.  
  8.  
I want to count domains
Expand|Select|Wrap|Line Numbers
  1. Emailid       count
  2. yahoo.com    2
  3. rediff.com      1
  4.  
Please give me the query to count that

Thanks in advance
Sang
Apr 26 '07 #1
2 1529
Hi,

Its so simple,try this query

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

Thanks,
Scarlet




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

For Example
Expand|Select|Wrap|Line Numbers
  1. Table User_account;
  2.  
  3. Emailid   Id
  4. qqq@yahoo.com 1
  5. eee@rediff.com   2
  6. jjjjj@yahoo.com  3
  7.  
  8.  
I want to count domains
Expand|Select|Wrap|Line Numbers
  1. Emailid       count
  2. yahoo.com    2
  3. rediff.com      1
  4.  
Please give me the query to count that

Thanks in advance
Sang
Apr 26 '07 #2
sang
83
Hi,

Its so simple,try this query

SELECT Emailid,COUNT(Emailid) 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)
Expand|Select|Wrap|Line Numbers
  1.  Select substring_index(emailid,'@',-1)as domain,count(Emailid) from User_
  2. account group by domain;
  3.  
Thank you for your reply
Sang
Apr 27 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: JP Belanger | last post by:
I have a question on select count(), which may betray my lack of database knowledge. Here goes. I have java code driving a transaction which goes like this: select count(*) from table ...
22
by: Joseph Shraibman | last post by:
On a 7.3.4 database: explain analyse select count(*) from elog; Aggregate (cost=223764.05..223764.05 rows=1 width=0) (actual time=81372.11..81372.11 rows=1 loops=1) -> Seq Scan on elog ...
1
by: JD | last post by:
Hi guys I'm trying to write a program that counts the occurrences of HTML tags in a text file. This is what I have so far: #include <stdio.h> #include <stdlib.h> #include <string.h> ...
10
by: Henk Ernst Blok | last post by:
Hi Posgres users/developers, Can anyone explain why PosgreSQL (version 7.4.5 on Linux) does a full table scan to compute a count(*) on a base table after a vacuum analyze has been done with no...
1
by: sammy | last post by:
If you have a select with 2 attributes where you group by one attribute and do a count() for the second attribute, if the count() is 0 then that row is never displayed. How would you instead see...
4
by: Chris | last post by:
Can't seem to figure out how to do this and have been reading for some time now...... I want to select a row count from a table name in SYSTABLES. This statement does not return what I needed,...
0
by: imran haq | last post by:
Hi All, I have 3 rather Long Questions that are causing alot of trouble: I would appreciate all the help i can get and tried to use A post sent to atli in the past but it did not help... !) I...
12
by: petter | last post by:
Hi! I have two questions: one question that regards the COUNT-function, and one about how to display a month even if I don’t have any data for that month. I have an Access database where I want...
1
by: kummu4help | last post by:
hi, i am using mysql. i have 3 tables with following structures. these are not actual tables i am working on. table A id varchar(16),name varchar(255),InDate datetime table B id...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.