I am unable to get records from objects which has relationship like the following.
We already knew that Account and contact have relationship where as Account is parent. I created a child for contact and the object name is Product. There is no any relationship between Account and Product.
But now, i want to get records of Contact and Account from Product which means Product is return type.
SELECT id, name, Product__c.contact__r.lastname, Product__c.contact__r.accountId from Product__c
By using the Above query, i can able to get product id and name, contact name and account id.
But How to get account name and phone(remaining fields) along with the Account id.
Please help me in this....