Quantcast
Channel: ADO.NET, Entity Framework, LINQ to SQL, NHibernate
Viewing all articles
Browse latest Browse all 1698

How to write subquery with alias column in ado.net entity

$
0
0

this is my raw sql query i want to get and show names of both people who applied for the job and who posted it from Users table. now problem is i can get names of people who applied for job with raw sql query but i don't know how to write it in ado.net entity query below is the working query which is fulfilling my purpose but its in raw sql not in ado.net entity

select u.Name,u.ID as postedBy,

AppliedBy=(select name from Users where Users.ID=a.U_ID),j.Job_ID, f.File_ID,f.FileName,f.FilePath,f.U_ID

from Users u left join Jobs j on u.ID=j.User_ID

left join Applied_Jobs a on j.Job_ID=a.Job_ID

left join Files f on a.U_ID=f.U_ID

where j.User_ID=3 and a.U_ID is not null


Viewing all articles
Browse latest Browse all 1698

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>