Forum Moderators: coopster
I have a table 'parts' which lists my inventory. There is an 'idmfg' in that table which links to 'mfg.idmfg' which holds different companies info. I have another table 'stores' which hold the data on places I buy these things from. I created a table called 'sku' and it holds 'idparts' and 'idstores' and also the 'sku' and 'cost'.
I am trying to create a query that shows all the stores that I purchased a certain sku. Something like
SELECT mfg.company, parts.item, stores.company, stores.city, sku.sku, sku.cost FROM mfg,parts,stores,sku WHERE sku.idsku=$_POST['skuid'] AND sku.idstores=stores.idstores AND sku.idparts=parts.idparts AND mfg.idmfg=parts.idmfg;
i get 148000 results all duplicates
basically how would I get the info from the mfg table from the link in the parts table from my query to the sku table and only the stores where I can purchase the item.
i hope that is clear i assume I need a subquery or something but the book I have is unclear on a practical application of that function.