Optimising (My)SQL Query
- by Simon
I usually use ORM instead of SQL and I am slightly out of touch on the different JOINs...
SELECT `order_invoice`.*, `client`.*, `order_product`.*, SUM(product.cost) as net
FROM `order_invoice`
LEFT JOIN `client` ON order_invoice.client_id = client.client_id
LEFT JOIN `order_product` ON order_invoice.invoice_id = order_product.invoice_id
LEFT…