This is a discussion on adding many rows to a table, compiled from many other tables within the MySQL Database forums, part of the Database Forums category; i am managing an online store. the shopping cart software is interesting, and stores data in many, many tables. i ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
i am managing an online store. the shopping cart software is
interesting, and stores data in many, many tables. i am trying to manipulate some data. certain products should have quantity discounts, so i would like to write a query that will let me add certain products en masse to a table that holds all info for quantity pricing. i have run a query that finds all the products that i need to update SELECT pID, pPrice FROM `ds_products` WHERE `pID` IN (SELECT pID FROM `ds_product_categories` WHERE `catID` = 115 OR `catID` = 122 OR `catID` = 117 OR `catID` = 123 OR `catID` = 120 OR `catID` = 121 OR `catID` = 119) AND pPrice != 0.00 ; with that, i have a list of every item that fits my specifications. i can see their ProductID and Price. There are a total of 53 items. now, i'd like to add them all to another table, ds_product_pricing, which has 4 columns excluding the auto-increment. these are : pID (info we have from the query), qtyMin (needs to be 20 for all of them), qtyMax(49 for all items), and qtyPrice, which is 90% of pPrice. maybe i have the syntax wrong in my INSERT. can someone please help me? david |