listOrders.DataSource = (from sp in dbdata.Specifications
join ord in dbdata.Orders on sp.O_id equals ord.O_id
join prd in dbdata.Products on ord.O_id equals prd.O_ID
where sp.Approve == "Yes" &&
sp.Awailable_BOM == "Yes" &&
prd.Hours_prd == null
orderby sp.O_id descending
select sp.O_id).Distinct();
在这里,我试图获得降级的价值。但它总是得到递增的值。如果我删除“Distinct()”它可以正常工作,但在添加“Distinct()”后会出现此问题。