I've got a database and its designed roughly like this:
tblParts
----------
partID
tblOrders
----------
partID
date
quantity
Ultimately I'd like to product output that looks something like this:
partID Aug 10 Aug 11 Aug 12 ... (say .. 100 days)
M061101 5 25 15
M061102 10 0 20
I can write a query to grab all the info for a single part:
SELECT * FROM tblParts LEFT JOIN tblOrders USING (partID);
but the results span many rows. So for many parts ... lots and lots of rows. How can I construct a query to return one row per part?
The ideal situation is being able to chose a range of dates and ending up with one row per part for that range of dates.