Hello all, I have these 2 tables
I have 506 entries in catalog and only 1 test item in inventory. I have join an left join that looks like this
and that will return all 506 rows including null or not null rows from inventory.quantity.
The problem is that I have to single out inventory.quantity where inventory.unide = '4'. So If I recreate the statement
then only one row is returned.
I need to return all 506 rows from catalog and join the catalog.id = inventory.catid where inventory.unode = 4 but still return all 506 rows.
Does this make sence???? can this be done??
Thanks,
timgerr
-How important does a person have to be before they are considered assassinated instead of just murdered?
So there you go! You're the retarded offspring of five monkeys having butt sex with a fish-squirrel! Congratulations!
Code:
Catalog:
+----------+--------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL |
| item1 | varchar(256) | NO | | |
| item2 | varchar(256) | NO | | |
| item3 | varchar(256) | NO | | |
| color | varchar(256) | NO | | |
| amount | varchar(25) | NO | | |
| price | varchar(25) | NO | | |
| quantity | varchar(1) | NO | | |
+----------+--------------+------+-----+---------+----------------+
Code:
Inventory:
+----------+--------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL |
| uid | varchar(6) | NO | MUL | |
| unode | varchar(256) | NO | MUL | |
| catid | varchar(5) | NO | MUL | |
| quantity | varchar(4) | NO | | |
| date | varchar(25) | NO | | |
+----------+--------------+------+-----+---------+----------------+
I have 506 entries in catalog and only 1 test item in inventory. I have join an left join that looks like this
Code:
"select catalog.id, catalog.price, inventory.quantity from catalog left join inventory on catalog.id = inventory.catid "
The problem is that I have to single out inventory.quantity where inventory.unide = '4'. So If I recreate the statement
Code:
select catalog.id, catalog.price, inventory.quantity from catalog left join inventory on catalog.id = inventory.catid where inventory.unode = '4'"
I need to return all 506 rows from catalog and join the catalog.id = inventory.catid where inventory.unode = 4 but still return all 506 rows.
Does this make sence???? can this be done??
Thanks,
timgerr
-How important does a person have to be before they are considered assassinated instead of just murdered?
So there you go! You're the retarded offspring of five monkeys having butt sex with a fish-squirrel! Congratulations!