I am trying to join the Pricebook2, Product2 and PricebookEntry objects together but do not understand how the syntax will work.
The relationship between the 3 objects are Pricebook2 is 1 to many with PricebookEntry and Product2 is 1 to many with PricebookEntry. I need to join the 3 tables and filter on the Family field in Product2 and the Name field in Pricebook2.
This query works to join Pricebook2 to PricebookEntry:
SELECT Name,(SELECT Name FROM PricebookEntries) FROM Pricebook2
and this query works to join Product2 to PricebookEntry:
SELECT Name,(SELECT Name FROM PricebookEntries) FROM Product2
How can I take the SOQL above and join the 3 tables together in 1 query?
Thanks