I have a table something like this :
Date|Person|Item|Qty
13/8/2006|Jim|Apple|5
13/8/2006|Mary|Apple|2
13/8/2006|Paul|Pear|3
13/8/2006|Ann|Apple|9
13/8/2006|Louise|Pear|2
13/8/2006|James|Orange|6
and so on ...
The following query (from access) produces the result I want :
TRANSFORM Sum(Qty) AS SumOfQty
SELECT Person, Item, Sum(Qty) AS Totals
FROM TableName
WHERE (((Date)=#13/10/2006#))
GROUP BY Product, PIVOT Person;
Which is Items on vertical axis, Persons across horizontal axis with qty's below persons along corresponding Item
Can anyone shed some light on how I produce the same result from MySql ?
Date|Person|Item|Qty
13/8/2006|Jim|Apple|5
13/8/2006|Mary|Apple|2
13/8/2006|Paul|Pear|3
13/8/2006|Ann|Apple|9
13/8/2006|Louise|Pear|2
13/8/2006|James|Orange|6
and so on ...
The following query (from access) produces the result I want :
TRANSFORM Sum(Qty) AS SumOfQty
SELECT Person, Item, Sum(Qty) AS Totals
FROM TableName
WHERE (((Date)=#13/10/2006#))
GROUP BY Product, PIVOT Person;
Which is Items on vertical axis, Persons across horizontal axis with qty's below persons along corresponding Item
Can anyone shed some light on how I produce the same result from MySql ?