I assume your sql has a typo on the correlation (both custids are from table [so.]) that will give you a lot of rows here's one way:select a.custname, i.item, i.amount, so.specialitem, so.specialamountfrom customer ainner join inventory i on a.custid = i.custidouter apply ( select top 1 so.specialitem ,so.specialamount from specialorder so where so.custid = a.custid order by specialamount desc --order by anything you want here ) so
Be One with the OptimizerTG