如何使用大量ORM从表中检索不同的行。我需要从具有列ID,StudentName,年龄的table" student"中获取唯一的学生名称列表。id是主要键。
注意:使用query()执行原始查询不是需要的。
何处:
dynamic studentTable = new Students();
var students = studentTable.All(columns: "distinct StudentName");
在StudentName列上创建非群集索引,然后尝试此查询
select distinct StudentName from Student