本文介绍了将SQL转换为Lambda LINQ的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 限时删除!! 从查询sql我需要接收lambda linq但绝对我理解语言,在lambda表达式中。有很多问题。但我试着去理解一切。非常大的SQL查询,其中一些JOIN和仍然不存在满足。我无法理解为比较一切虽然我参与了,但可以吃比我更短的方式。 SELECT DISTINCT pblpat.nplpartref, ppartt.npartgenu, ppartt .xpartext, pblpat.xordergun, pblpat.hpartplblk, ppartt.creplblpart FROM pblpat JOIN ppartt ON (ppartt.clangjap = ' 2' AND ppartt.npartgenu = pblpat.npartgenu ) LEFT OUTER JOIN pbprmt ON (pbprmt.hpartplblk = pblpat.hpartplblk AND pbprmt.clangjap = ' 2' ) WHERE pblpat.npl = ' 18SD401' AND pblpat.nplblk = ' BOP0100' AND (( EXISTS ( SELECT pb.hmodtyp FROM pbpmtt AS pb WHERE pb.hpartplblk = pblpat.hpartplblk AND pb .hmodtyp = ' 23436')) OR (( NOT EXISTS ( SELECT pb.hmodtyp FROM pbpmtt AS pb WHERE pb.hpartplblk = pblpat.hpartplblk)) AND ( EXISTS ( SELECT pb.hmodtyp FROM pblmtt AS pb WHERE pb.npl = pblpat.npl AND pb.nplblk = pblpat.nplblk AND pb.hmodtyp = ' 23436')))) 解决方案 您可以尝试 Linqer [ ^ ],但要注意任何自动SQL到Linq转换可能不是最理想的。 / ravi 使用像LINQPad [ ^ ] from inquiry sql I need to receive lambda linq yet absolutely I understood language, in a lambda expressions. There are many questions. But I try to understand everything rather. Very big SQL inquiry, in which some JOIN and still NOT EXIST met. I can't understand in any way as to compare everything though I made part, but can eat ways shorter than mine.SELECT DISTINCT pblpat.nplpartref , ppartt.npartgenu , ppartt.xpartext , pblpat.xordergun , pblpat.hpartplblk , ppartt.creplblpartFROM pblpat JOIN ppartt ON ( ppartt.clangjap = '2' AND ppartt.npartgenu = pblpat.npartgenu ) LEFT OUTER JOIN pbprmt ON ( pbprmt.hpartplblk = pblpat.hpartplblk AND pbprmt.clangjap = '2' )WHERE pblpat.npl = '18SD401' AND pblpat.nplblk = 'BOP0100' AND ( ( EXISTS ( SELECT pb.hmodtyp FROM pbpmtt AS pb WHERE pb.hpartplblk = pblpat.hpartplblk AND pb.hmodtyp = '23436' ) ) OR ( ( NOT EXISTS ( SELECT pb.hmodtyp FROM pbpmtt AS pb WHERE pb.hpartplblk = pblpat.hpartplblk ) ) AND ( EXISTS ( SELECT pb.hmodtyp FROM pblmtt AS pb WHERE pb.npl = pblpat.npl AND pb.nplblk = pblpat.nplblk AND pb.hmodtyp = '23436' ) ) ) ) 解决方案 You may want to try Linqer[^], but be warned that any automated SQL to Linq conversion is likely to be suboptimal at best./raviUse tools like LINQPad[^] 这篇关于将SQL转换为Lambda LINQ的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 1403页,肝出来的..
09-07 15:11