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

  • Thread starter Thread starter Shahzaib17
  • Start date Start date
S

Shahzaib17

Guest
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

Continue reading...
 
Back
Top