I need to run a query on a partitioned table, and I'd like a result by partition, like so:
partition result count
----------- ---------- ------
p1 apples 2
p1 oranges 3
p2 apples 10
p2 oranges 15
From the official MySQL docs online, if we had 5.6 or later, we'd be able to use the PARTITION clause to specify where to get the data from, but we're currently stuck at 5.1.63. Is there an easy way to do this, regardless of the partitioning scheme of the table?