首页 > 解决方案 > 如何在asp.net mvc c#中区分我的表行?

问题描述

我想区分我的聊天表行以显示 PV。请看下图:

在此处输入图像描述

标签: c#sqlasp.net-mvc

解决方案


If you are using T-SQL try like this in your SQL query (unless you are using Entity Framework)

SELECT DISTINCT
 ChatId
 SendUserId
 ...
FROM
 YourTable;

This will select rows with distinct combination of all the fields in query.


推荐阅读