Quantcast
Channel: ADO.NET, Entity Framework, LINQ to SQL, NHibernate
Viewing all articles
Browse latest Browse all 1698

How to get distinct count of rows based on country code

$
0
0

see how data is stored in my data table.

DateAmountCountryCode---------------------01/01/201710		GB02/01/201702		GB03/01/201705		GB01/01/201703		US02/01/201722		US03/01/201709		US04/01/201711		US01/01/201708		MX02/01/201713		MX

suppose my data table has 3 columns one is date, another one is amount and last one is country code.

now i want to get no of distinct rows based on unique country code. so the answer would be 3 because 3 different kind of country code related data is stored in data table.

so now tell me how could i programmatically get the distinct rows based on country code from data table. please answer with sample code. thanks


Viewing all articles
Browse latest Browse all 1698

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>