gpt4 book ai didi

mysql - Linq-查询主体必须以 C# 中的 select 子句或 group 子句结尾

转载 作者:行者123 更新时间:2023-11-29 11:51:59 30 4
gpt4 key购买 nike

像这样执行交叉表操作时出现错误。

 var rows = from a in db_data.AsEnumerable()
join b in cust_data.AsEnumerable()
on a["SERVICE_ZIP"].ToString().Trim().ToLower() equals b["Zip"].ToString().Trim().ToLower()
where
a["SSS"].ToString().Trim().ToLower() == b["SSS"].ToString().Trim().ToLower() &&
a["ttt"].ToString().Trim().ToLower() == b["ttt"].ToString().Trim().ToLower()
into g
where g.Count() > 0
select a;
DataTable merged;
if (rows.Any())
merged = rows.CopyToDataTable();
else
merged = cust_data.Clone();

最佳答案

使用into子句可以将LINQ理解表达式链接在一起,这是非常强大的。但每个都必须是完整的理解表达式。

代码中 into 之前没有 selectgroup 子句。

关于mysql - Linq-查询主体必须以 C# 中的 select 子句或 group 子句结尾,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33912613/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com