Link to home
Start Free TrialLog in
Avatar of GIP
GIP

asked on

Count of same row

Hi,

I want to know if there are function to return count of the same row data in DataTable

Example

City, Name
New York, Paul
Boston, Catherine
New York, Cathy
New York, Debby

I want the number of city
In this example, the answer is two (New York, Boston)
ASKER CERTIFIED SOLUTION
Avatar of Randy Poole
Randy Poole
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Shaun Kline
You can use the DataView.ToTable() function.
This link is to the overload that will only add distinct values to the new table based on the selected columns:
http://msdn.microsoft.com/en-us/library/wec2b2e6(v=vs.110).aspx
Avatar of GIP
GIP

ASKER

I decided to use a second table in my SQL query to return my value

Shaune thank you for your answer too.

SELECT COUNT(Distinct NomFamille) From #TempCommandeExcel

Open in new window