I have a big table contain a mobile numbers, I need to count each mobile number, how many time it was entered to my table?
Mashimar
0
Newbie Poster
Recommended Answers
Jump to PostYou're talking about DB table, right?
Assuming you have mobile phone numbers in a "unified format", this SQL statement returns unique numbers and their count:
SELECT DISTINCT(<MobileNumberField>), COUNT(<MobileNumberField>) AS MobileNumberCount FROM <tablename> GROUP BY <MobileNumberField>
Just replace field and table names before you use that.
Jump to PostSELECT DISTINCT(MobileNumber), COUNT(MobileNumber) AS RecordCount FROM MobileTable GROUP BY MobileNumber
All 7 Replies
Teme64
215
Veteran Poster
sierrainfo
0
Junior Poster
dyadarling
0
Newbie Poster
Teme64
215
Veteran Poster
dyadarling
0
Newbie Poster
manal
27
Junior Poster
dyadarling
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.