select s.sectionName , i.itemId , i.itemName -- other inventoryItem columns as needed , p1.price , "sale_price" = p2.price from section s left join inventoryItem i on s.sectionId = i.sectionId left join itemPrice p1 on i.itemId = p1.itemId and p1.type = 0 left outer join itemPrice p2 on p1.itemId = p2.itemId and p2.type = 1 and p2.fromDate < getdate() and p2.toDate > getdate()