0

如何使用大量 ORM 从表中检索不同的行。我需要从具有列 ID,StudentName,Age 的表 'Student' 中获取唯一学生名的列表。ID 是主键。

注意:不需要使用 Query() 执行原始查询。

4

2 回答 2

2

那这个呢:

dynamic studentTable = new Students();
var students = studentTable.All(columns: "distinct StudentName");
于 2012-12-09T05:31:12.230 回答
0

在 studentname 列上创建非聚集索引,然后尝试此查询

select distinct StudentName from Student
于 2012-11-09T06:20:43.780 回答