hello list,

I'm having trouble with an INSERT command based on a select

Is what I want is in my contacts table I'm selected certain criteria and
then inserting a note into my contactnotes table certain values

Here's what I have so far

contactnotes mysql table headers:
________________________________________
     |           |      |        |
code + contactno + note + source + date
_____|___________|______|________|______


INSERT INTO contactnotes
        SELECT code, country, show_qty, completed
        FROM contacts
        WHERE country = US AND show_qty = 1 AND completed != 1

The bulk values that I want to insert into contactnotes are:
code = AUTO_INCREMENT
contactno = code.contacts   <---from the select statement
note = Show catalog sent to user
source = catalogs
date = %Y%M%d

All based on the select statement

Any help would be appreciated


J. Scott Andreas :)
IS/Programmer/WebDevelopement
Learning Services, Inc.
e-mail: [EMAIL PROTECTED]
phone: 1-800-877-9378 ext. 146
fax: (541) 744-2056

       ---    __o
     ---   _-\<,_
      --- (_)/ (_)



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

Reply via email to