本文介绍了数据重复.即如果印度在该位置,则将其打印3次.只想要1次.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

var prpty = from pm in rdc.tbl_PropertyMasters
join pt in rdc.tbl_PropertyTypes on pm.PropertyTypeId equals pt.PropertyTypeId
join loc in rdc.tbl_Locations on pm.LocationId equals loc.LocationId
join city in rdc.tbl_Cities on pm.CityId equals city.CityId
select new
{
    pt.PropertyType,
    loc.LocationName,
    city.CityName,
}

推荐答案

var prpty = (from pm in rdc.tbl_PropertyMasters
                                    join pt in rdc.tbl_PropertyTypes on pm.PropertyTypeId equals                                    pt.PropertyTypeId
                                    join loc in rdc.tbl_Locations on pm.LocationId equals loc.LocationId
                                    join city in rdc.tbl_Cities on pm.CityId equals city.CityId
                                    select new
                                    {
                                          pt.PropertyType,
                                          loc.LocationName,
                                          city.CityName,
                                    }).Distinct(); 




这篇关于数据重复.即如果印度在该位置,则将其打印3次.只想要1次.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-12 14:14