Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何使用大量 ORM 从表中检索不同的行。我需要从具有列 ID,StudentName,Age 的表 'Student' 中获取唯一学生名的列表。ID 是主键。
注意:不需要使用 Query() 执行原始查询。
那这个呢:
dynamic studentTable = new Students(); var students = studentTable.All(columns: "distinct StudentName");
在 studentname 列上创建非聚集索引,然后尝试此查询
select distinct StudentName from Student