So I'm joining two tables together and then I'm trying to order first by PID and then within PID order by Month. I can manage to get the query working and ordering by PID but when I try to order by month as well the query keeps running out of memory.
SELECT l.Name, l.PID, Z.Month
FROM Z
INNER JOIN l ON l.Name=Z.Name
ORDER BY l.PID, Z.Month ASC;
Desired output:
Bob, 1, 01
Bob, 1, 02
Bob, 1, 04
Gary, 2, 03
Gary, 2, 08
Louis, 3, 01
Louis, 3, 02
etc. Note how month is ordered inside of the PID order. Both Month and PID are integers.