[eluser]seanloving[/eluser]
I have a products table (product_id, part_number, description, price, etc)
I have an inventory table (inventory_id, product_id, serial_number, etc)
For each product in my products table I want to count the number of times the product_id appears on the inventory table.
Basically, I want to retrieve the entire products table, but with a 'quantity' field added to the results showing the count of each product in inventory.
I can show my code, but this is basically a procedural question. Right now I am using a foreach loop and it works just fine. However, I was wondering if there is a way to perform this operation as a SINGLE query?
Thanks!
SL