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.
如果我有这样的数据表:
pic_id selected 1 1 1 1 1 0 2 0 2 0 2 0
我想获得独特的(pic_id)
但在至少一张图片(具有相同id)的selected值=1的情况下
selected
对于前面的例子
我想要这样的结果:
1 1
var list = dataTable.Select("selected = 1"); var uniqueList = list.Distinct().ToList();