Sql to LINQ Query how to apply sub query in LINQ
**SELECT DISTINCT S.SUPPNAME,开发者_StackOverflow S.SUPPCODE FROM ET_POHEAD P, EM_SUPP_MST S
WHERE TRIM(ORDTYPCODE) IN
(SELECT ORDTYPCODE FROM EM_ORDTYP_MST WHERE PYMT_VCHR = ''Y'')
AND RTRIM(STATCODE) = ''000090'' AND p.suppid = s.suppid
ORDER BY 2;**
Please give me solution of this query.. Sorry guys i m new in LINQ query...
I don't think this really is exactly what stackoverflow is for, but I'll give you some rough guidelines:
From p in et_pohead, s in em_supp_mst
Where ( (from m in em_ordtyp_mst where m.pymt_vchr = "Y").contains(s.ordtypcode)
and s.statcode.rtrim() = "000090" and p.suppid = s.suppid )
Select s.suppname, s.suppcode Distinct
I'd really be surprised if that just works (typed from memory), but give it a shot. Hopefully you'll be able to work out the rest.
精彩评论