Skip to content
Advertisement

What is the correct way to use LEFT JOINS, GROUP BY, and ORDER BY together?

I have an SQL Query (MySQL) which uses a combination of LEFT JOIN, GROUP BUY, ORDER BY, and LIMIT. When I remove LEFT JOIN and GROUP BY it works fine. What is the correct way to add in my additional LEFT JOIN and GROUP logic to make this work?

Advertisement

Answer

Your syntax is incorrect – where clause will be before group by

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement