skip to Main Content

Mysql in Query to join query Optimisation

Trying to debug a slow query: SELECT IFNULL(SUM(bt.transactionQuantity * bpd.unitPrice), 0) FROM batchTransaction bt LEFT JOIN batch b ON b.id = bt.batchId LEFT JOIN batchPricingDetails bpd ON bpd.id = b.batchPricingDetailsId WHERE (bt.productId, bt.dateCreated) IN ( SELECT productId, MAX(dateCreated) FROM batchTransaction…

VIEW QUESTION
Back To Top
Search