Required help to Increase the performance of the MySQL query
- by Joseph
Hi all,
I am using a following query in MySQl for fetching data from a table. Its taking too long because the conditional check within the aggregate function.Please help how to make it faster
SELECT
testcharfield
,SUM(IF (Type = 'pi',quantity, 0)) AS OB
,SUM(IF (Type = 'pe',quantity, 0)) AS CB
FROM Table1
WHERE
sequenceID = 6107
GROUP BY testcharfield