SQL to Linq Converter
select * from tab
Raj kumar VS
select * from tab
select * from (select * from sregUHSP
where SUHSPsavpid = :1 AND SUHSPInitialDate <= :2
AND nvl(SUHSPLastDateActive, 'N') = 'N'
AND ((suhspnextdate is null) OR (suhspnextdate <= :3))
union select * from sregUHSP
where SUHSPsavpid = :4 AND SUHSPInititalDate <= :5
AND nvl(SUHSPLastDateActive, 'N') = 'Y'
AND ((suhspnextdate is null) OR (suhspnextdate <= :7))
order by 1,2,3) u
left join sreghref href on href.shrefissuerid = u.SUHSPIssuerId
AND href.shrefnumb = u.SUHSPNumb
AND href.shrefhsubtype = u.SUHSPSubType
join sregmbal m on m.smbalissuerid = u.suhspissuerid
AND m.smbalnumb = u.suhspnumb
AND m.smbalclass = u.suhspclass
left join (select b.investorreferenceid, b.reference BondPolicy,
f.paidinfull from bondfuneraldata f
join bond b on b.id = f.bondid) contract
on contract.investorreferenceid = href.shrefreferenceid
AND trim(u.suhspcert) = trim(contract.BondPolicy)
where m.smbalunits > 0
SELECT createdat as month, SUM(CASE WHEN typeRecord = 1
THEN amount ELSE 0 END) as credits,
SUM(CASE WHEN typeRecord = 0
THEN amount ELSE 0 END) as debts,
((SUM(CASE WHEN typeRecord = 1
THEN amount ELSE 0 END)) - (SUM(CASE WHEN typeRecord = 0
THEN amount ELSE 0 END))) as balance
FROM OcurrencesRecord
GROUP by month;
select top 10 p.Nombre, p.Apellidos, (SELECT COUNT(*) FROM Personas ps WHERE PS.ParentCode LIKE '%' + CONVERT(VARCHAR, p.id) + '-%' ) Total
from personas p
ORDER BY Total desc