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'
var res = (from cust in CRMEntites.Customers join user in CRMEntites.Users on cust.uID equals user.uID join refCust in ( ) where cust.IsActive == true && cust.IsDelete == false && user.rID == 3 select new RefCust { }).ToList();
IN
var q = from d in Dealer join dc in DealerConact on d.DealerID equals dc.DealerID select dc;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)