dawood abbas

dawood abbas

  • NA
  • 56
  • 4.8k

How to join two joined tables with inner query in linq?

Jan 9 2019 8:32 AM
How to join two joined tables with inner query in linque? same like below I tried in sql server 
 
select refCustGrouped.Extension,refCustGrouped.CreatedOn,users.MobileNo,users.Name,cust.Status,users.IsDelete
from [there_crm].[therecrm_admin].[User] users
join [there_crm].[therecrm_admin].[Customer] cust on users.uID = cust.uID
join (
select top 1 with TIES refCust.cuRefID,refCust.MobileNo,
refCust.CreatedOn,refCust.Extension
from [there_crm].[therecrm_admin].[RefCustomer] refCust
ORDER BY
ROW_NUMBER() OVER(PARTITION BY refCust.MobileNo ORDER BY refCust.cuRefID DESC)
) refCustGrouped on refCustGrouped.MobileNo = users.MobileNo
where users.IsDelete Is NULL or users.IsDelete = 0 and users.rID = 3 and cust.Status = 'INV' or cust.Status = 'VIS'

Answers (4)