sql distinct * code example
Example 1: C# .NET Core linq Distinct
var distinctUsers = allUsers
.GroupBy(x => x.UserId)
.Select(x => x.First())
.ToList();
Example 2: query DISTINCT
SELECT DISTINCT Column_name FROM table_name;
var distinctUsers = allUsers
.GroupBy(x => x.UserId)
.Select(x => x.First())
.ToList();
SELECT DISTINCT Column_name FROM table_name;