Welcome Guest, Not a member yet? Register   Sign In
use foreach or single query? (Counting Inventory)
#9

[eluser]seanloving[/eluser]
[quote author="noctrum" date="1264206008"]
Just saw that you have two joins... You would need to left join inventory and locations to products[/quote]

I have tried using 'left' on both of my joins above (thanks @noctrum ;-) ) but still I get no results for the products that are not in inventory (i.e. a product whose product_id does not identify at least one record on the inventory table).

[quote author="noctrum" date="1264206008"] (qty value will probably need to be changed to something like "count(inventory.*) AS qty" as well)[/quote]

That syntax no work, but similar did not work either. RANT: I spent too much time on this what should be simple.:long:

Alas, I'm still trying to display my product list with a quantity column that properly shows qty=0.

What I want is this:
- If a particular product on my product list does not appear on the inventory table, then that product should appear on my query results and its quantity should be 0.

What I have is this:
- That product is not appearing on my query results.



SL


Messages In This Thread
use foreach or single query? (Counting Inventory) - by El Forum - 01-22-2010, 07:21 AM
use foreach or single query? (Counting Inventory) - by El Forum - 01-22-2010, 07:35 AM
use foreach or single query? (Counting Inventory) - by El Forum - 01-22-2010, 07:49 AM
use foreach or single query? (Counting Inventory) - by El Forum - 01-22-2010, 09:05 AM
use foreach or single query? (Counting Inventory) - by El Forum - 01-22-2010, 09:29 AM
use foreach or single query? (Counting Inventory) - by El Forum - 01-22-2010, 10:24 AM
use foreach or single query? (Counting Inventory) - by El Forum - 01-22-2010, 11:07 AM
use foreach or single query? (Counting Inventory) - by El Forum - 01-22-2010, 12:20 PM
use foreach or single query? (Counting Inventory) - by El Forum - 01-22-2010, 01:54 PM
use foreach or single query? (Counting Inventory) - by El Forum - 01-22-2010, 02:02 PM
use foreach or single query? (Counting Inventory) - by El Forum - 01-22-2010, 03:43 PM
use foreach or single query? (Counting Inventory) - by El Forum - 01-22-2010, 04:05 PM
use foreach or single query? (Counting Inventory) - by El Forum - 01-22-2010, 04:43 PM
use foreach or single query? (Counting Inventory) - by El Forum - 01-22-2010, 04:46 PM
use foreach or single query? (Counting Inventory) - by El Forum - 01-22-2010, 08:21 PM



Theme © iAndrew 2016 - Forum software by © MyBB