This is the wrong list for MySQL questiosn, but I believe you are probably looking to replace the matching record, use MySQL "INSERT REPLACE INTO tablename....".
Mimi => -----Original Message----- => From: S Pratap Singh [mailto:kdari...@gmail.com] => Sent: 20 October 2010 07:37 => To: beginners@perl.org => Subject: PERL MYSQL query "IF EXISTS then UPDATE else INSERT" => => Hello, => => I want to update my database if the key value is already there then it => will => update the required field else it will insert the new row in the same => table. => => => Insert query works fine but I am not able to figure out how to achieve => this => "IF EXISTS then UPDATE else INSERT" using a one liner MYSQL statement => . If => someone can give me an example to write such query and execute it from => perl => then it would be really appreciated. => => Thank you. => Pratap -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/