gpt4 book ai didi

linq-to-sql - 将 SQL 转换为 LINQ 到 SQL

转载 作者:行者123 更新时间:2023-12-03 19:50:31 25 4
gpt4 key购买 nike

我在将以下 SQL 转换为 LINQ to SQL 时遇到了很大的麻烦,有人能帮忙吗?

SELECT     dbo.ExpensesGroup.ExpenseGroupId, dbo.ExpensesGroup.Title, SUM(dbo.Expenses.Amount) AS TotalAmount, MAX(dbo.Expenses.DateLastTickled) 
AS LastTickledDate, MAX(dbo.ExpensesGroup.DateTime) AS Date, Username
FROM dbo.Expenses INNER JOIN
dbo.ExpensesGroup ON dbo.Expenses.ExpenseId = dbo.ExpensesGroup.ExpensesId
WHERE dbo.Expenses.Status = 'AwaitingApproval' or dbo.Expenses.Status = 'AwaitingApprovelGrouping'
GROUP BY dbo.ExpensesGroup.ExpenseGroupId, dbo.ExpensesGroup.Title, dbo.Expenses.Username
ORDER BY MAX(dbo.ExpensesGroup.DateTime) DESC, dbo.ExpensesGroup.Title

或者甚至更好的人知道自动 SQl 到 LINQ 转换器?

最佳答案

this现有线程。

如果您决定手工制作,Linqpad应该有用。

关于linq-to-sql - 将 SQL 转换为 LINQ 到 SQL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1339732/

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