Two Stars

Count nomber of iteration of element

Hello, 

 

I want to count nomber of iteration of element, in my CVS or out of Sql database. Who can I do this ? 

 

For exemple : 

Select Phone from Phone_client

Result :

-+33626459863

-+33626459863

-+33626459863

-+33626898756

 

Here I want : +33626459863 repeat 3 time   | +33626898756 repeat 1 time

 

Thank you for your help.

1 REPLY
Employee

Re: Count nomber of iteration of element

Hi,

 

     Please use group by clause in your query. In your previous example, the modified query will be

 

Select Phone, count(*) as cnt

from Phone_client

group by Phone;

 

Warm Regards,

 

Nikhil Thampi