IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Query to know which number how many times repeated


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ismail1816

New User


Joined: 28 Nov 2008
Posts: 3
Location: bangalore

PostPosted: Mon Dec 01, 2008 11:16 am
Reply with quote

Hi All,

I have 10 phone numbers each phone will be come atleast ones some phones will be come more then ones also I want to know which number how many times repeated. Given below I am showing my expected result. According that result any body can you sagest me how to write the db2 query...

Telnumb
------------- ---
9652146584 2
9362548712 1
9658745222 7
Back to top
View user's profile Send private message
Prasanthhere

Active User


Joined: 03 Aug 2005
Posts: 306

PostPosted: Mon Dec 01, 2008 11:26 am
Reply with quote

How about this query

SELECT Phonenumber,COUNT(Phonenumber) AS COUNT FROM
tablename
GROUP BY Phonenumber ;
Back to top
View user's profile Send private message
ismail1816

New User


Joined: 28 Nov 2008
Posts: 3
Location: bangalore

PostPosted: Mon Dec 01, 2008 11:40 am
Reply with quote

Hi Prasanth,

It's working properly thanks given this query
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Substring number between 2 characters... DFSORT/ICETOOL 2
No new posts Generate random number from range of ... COBOL Programming 3
No new posts RC query -Time column CA Products 3
No new posts Increase the number of columns in the... IBM Tools 3
Search our Forums:

Back to Top