HOw can i overcome The SQL query exceeded the maximum number of joins. The allowed limit is 5 error

Author: iamthiru

I wrote a query to fetch customer as below .

SELECT customer
FROM catalog join industry in catalog.Industy  
join category in industry.Category   
join Subcategory in category.Subcategory
join product in Subcategory.Product
join MethodOfPreparation in product.MethodOfPreparation 
join customer in MethodOfPreparation.Customer 

but ,i got the following error

The SQL query exceeded the maximum number of joins. The allowed limit is 5

How can i solve this. please any one help me?

Originally Sourced from: https://stackoverflow.com/questions/57882202/how-can-i-overcome-the-sql-query-exceeded-the-maximum-number-of-joins-the-allow