Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Query a list for distinct and top 1

$
0
0

Hi there

I am wondering what would be the best way to query a list for distinct value in one column and sorted by other one and get the top 1 record.

In tsql I would do something like that if I want to see the all customers last Order  

SELECT   Customer   , MAX(LastOrderDate) AS LastOrder
FROM      CustomerOrder   
GROUP BY Customer   

How can I apply this query to list with CMAL or Linq query?

Thanks


Viewing all articles
Browse latest Browse all 7589

Trending Articles



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