Bluehost.com Web Hosting $6.95

adding many rows to a table, compiled from many other tables

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 ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-01-2007
theneonlobster@gmail.com
 
Posts: n/a
Default adding many rows to a table, compiled from many other tables

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

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 09:20 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0