LISTING 3: Eliminate Remaining Subqueries by Using Three-Table Join select 'MattressPrice' = two.Price, 'MattressMsrp' = two.Msrp, two.RailIDN, 'RailPrice' = one.Price, 'RailMsrp' = one.Msrp, two.BoxspringIDN, 'BoxspringPrice' = three.Price, 'BoxspringMsrp' = three.Msrp, 'Name' = two.ItemName from Items one inner join Items two on one.IDN = two.RailIDN and two.IDN = @IDN inner join Items three on three.IDN = two.BoxspringIDN