यह एक समान क्वेरी होनी चाहिए:
SELECT
cat,
SUM(IF(item = 0,data,0)) AS data0,
SUM(IF(item = 1,data,0)) AS data1
FROM table GROUP BY cat;
यह एक समान क्वेरी होनी चाहिए:
SELECT
cat,
SUM(IF(item = 0,data,0)) AS data0,
SUM(IF(item = 1,data,0)) AS data1
FROM table GROUP BY cat;