Вопрос

How can I retrieve distinct rows from a table using massive ORM . I need to get list of unique studentname from table 'Student' that has columns ID,StudentName,Age . ID is the primary key.

Note : executing raw query using Query() is not what is needed.

Это было полезно?

Решение

What about this:

dynamic studentTable = new Students();
var students = studentTable.All(columns: "distinct StudentName");

Другие советы

create non-clustered index on studentname column and then try this query

select distinct StudentName from Student
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top