Re: Insert only if the entry doesn't exist

2011-02-15 Thread Joerg Bruehe
Hi! Andre Polykanine wrote: > Hello Rolando, > > So if I do > "INSERT IGNORE INTO `Votes` SET `EntryId`='12345', UserId`='789'"; > it *won't* insert the second row if there's a row with EntryId set to > 12345 and UserId set to 789? If you want to have at most one vote per user on any entry, IM

Re: Insert only if the entry doesn't exist

2011-02-14 Thread Andre Polykanine
, Andre Skype: Francophile My blog: http://oire.org/menelion (mostly in Russian) Twitter: http://twitter.com/m_elensule Facebook: http://facebook.com/menelion Original message From: Rolando Edwards To: Andre Polykanine Date created: , 11:01:40 PM Subject: Insert only if the entr

RE: Insert only if the entry doesn't exist

2011-02-14 Thread Rolando Edwards
nine [mailto:an...@oire.org] Sent: Monday, February 14, 2011 3:40 PM To: Rolando Edwards Cc: João Cândido de Souza Neto; mysql@lists.mysql.com Subject: Re: Insert only if the entry doesn't exist Hello Rolando, Sorry, but if I do INSERT IGNORE INTO, then I must indicate a key (typically a unique

Re: Insert only if the entry doesn't exist

2011-02-14 Thread Andre Polykanine
http://oire.org/menelion (mostly in Russian) Twitter: http://twitter.com/m_elensule Facebook: http://facebook.com/menelion Original message From: Rolando Edwards To: João Cândido de Souza Neto Date created: , 10:33:05 PM Subject: Insert only if the entry doesn't exist

RE: Insert only if the entry doesn't exist

2011-02-14 Thread Rolando Edwards
bject: Re: Insert only if the entry doesn't exist Instead of "insert into" you can use "replace into". -- João Cândido de Souza Neto "Andre Polykanine" escreveu na mensagem news:1621362474.20110214201...@oire.org... Hi all, Thanks for your fast answer to my last

Re: Insert only if the entry doesn't exist

2011-02-14 Thread Jo�o C�ndido de Souza Neto
Instead of "insert into" you can use "replace into". -- João Cândido de Souza Neto "Andre Polykanine" escreveu na mensagem news:1621362474.20110214201...@oire.org... Hi all, Thanks for your fast answer to my last question! Here's one more problem I commonly deal with. There are cases when

Insert only if the entry doesn't exist

2011-02-14 Thread Andre Polykanine
Hi all, Thanks for your fast answer to my last question! Here's one more problem I commonly deal with. There are cases when I need to insert the row only if such a row doesn't exist, otherwise I need either to update the row or to do nothing, just skip the query. The common case is the rat