我试图将ans sql查询转换为linq。但我有困难!有人愿意帮忙吗? :)
SELECT MOV.ORIGINE AS origine, TAX.ID as codice, TAX.descrizione, Sum(IIF(MOV.INCREMENTA,0,MOV.IMPORTO)) AS importi, Sum(IIF(MOV.INCREMENTA,-MOV*IMPORTO,0)) AS sconti, Sum(IIF(MOV.INCREMENTA,-1,1)*MOV.IMPORTO) AS totale
FROM (MOV INNER JOIN TAX ON (MOV.COD_TAX = TAX.ID) AND (MOV.ORIGINE = TAX.ORIGINE))
WHERE MOV.DATA BETWEEN [@F] AND [@T] AND TAX.CONTEGGIO
GROUP BY MOV.ORIGINE, TAX.ID, TAX.DESCRIZIONE, TAX.IMPONIBILE
ORDER BY MOV.ORIGINE DESC, TAX.IMPONIBILE
mov和tax在我的程序中由两个已经填充了适当数据的数据表
表示