Hey all, I've been given the task of adding a few hundred, and later a few thousand, new records to my database that currently exist in (ugh...) an excel spreadsheet. I was able to very quickly and efficiently deal with the initial insertion of the main data to the main table, but am having difficulty figuring out how to get the related information into the related table. Now, if that didn't make any sense, here's exactly what I'm trying to do:
I have a table named suppliers which has, among other things, a column named ID, which is likely to be the only important column for this issue. This is the table that was easy to populate. I also have a second table called suppliercatlink which holds 3 columns as ID, SUPID, CATID. SUPID in this table relates to ID in the supplier table. ID in this table autoincrements. What I need to do is insert into suppliercatlink SUPID,CATID values(supplier.ID,123) where supplier.id > 100 and supplier.id < 200. the CATID will be the same for all of these entries, the only thing that will vary is the supplier.ID, and the CATID should (theoretically) autoincrement. I'm sure there is a relatively simple way to deal with this, but for the moment I am about as lost on how to properly deal with this. (And in fact feel that I could probably have added the CATID to the spreadsheet and included it in the initial sql statement somehow, but don't want to get that complicated... yet.) Thanks for the help! Jason Drake [EMAIL PROTECTED] query mysql --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php