|
Posted by Rik on 10/24/06 21:32
Daz wrote:
> Rik wrote:
>> My solution was purely to give him back the information he wants (he
>> not only wants to reject invalids, update already existing, and
>> insert new, but he wants to know which ones they are).
>>
>> The actual updating can still be done with the previous simple
>> replace into, avoiding race condition.
>
> That is indeed a good solution to help me find what needs to happen
> with which data. However, I cannot use REPLACE INTO as I am unable to
> run any kind of index on the table that I need to update, and from
> what
> I can see, it's a requirement.
I have told you several times an index on 2 columns is perfectly possible.
Make the index:
ALTER TABLE `user_books` ADD UNIQUE (
`user_id` ,
`book_id`
)
Voilα.
--
Rik Wasmus
Navigation:
[Reply to this message]
|