select distinct b.Name,A.*,C.* from tblProduct A inner join tblBrands B on A.PBrandID = B.BrandId cross apply( select top 1 * from tblProductImages C where A.PId= c.PID order by b.Name desc )C order by b.Name desc
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)