Markus,
Monday, May 27, 2002, 4:59:30 PM, you wrote:

ML> Is there a simple way to do something like INSERT IF NOT EXISTS,
ML> other than first doing a SELECT and checking if it returns any rows?
ML> If not, that would be pretty high up on my whish-list : )

You can use IGNORE keyword in INSERT statement, but it's not quite the
same as "INSERT IF NOT EXIST". If you specify IGNORE, any rows that
duplicate an existing PRIMARY or UNIQUE key in the table
will be ignored in INSERT:
     http://www.mysql.com/doc/I/N/INSERT.html

Also check REPLACE statement:
     http://www.mysql.com/doc/R/E/REPLACE.html

ML> Cheers,
ML> Markus




-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Victoria Reznichenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.com




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