That's better, but only if you know for sure that the data doesn't
contain '-'.

Otherwise, you run into the same problem with the following values:
'1-','2','3' -> '1','-2','3'

Imanuel



Am 25.11.2012 17:35, schrieb Roger Andersson:
> Then something like
> WHERE a||'-'||b||'-'||c||'-' != ...
> 
> Maybe there are other drawbacks?
> 
> //Roger
> -----Ursprungligt meddelande----- From: Imanuel Sent: Sunday, November
> 25, 2012 5:22 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] WAL
> and updates
> I'm not saying your statement is inefficient, I'm saying it's wrong
> because it produces unwanted results.
> 
> If the fields a,b,c ('12','34','56') should be updated to
> ('1','2345','6') your statement would fail instead of doing the expected
> update.
> 
> Which means with every false hit it has less data to write and thus is
> faster because of the false hits (instead of "even with").
> 
> Imanuel
> 
> 
> 
> Am 25.11.2012 17:13, schrieb Simon Slavin:
>>
>> On 25 Nov 2012, at 4:11pm, Imanuel <my_mailings_addr...@gmx.de> wrote:
>>
>>> Hi Keith
>>>
>>>> UPDATE user SET a=1,b=2,c=3 WHERE a||b||c!=1||2||3;
>>>
>>> It seems to me that this is not reliable.
>>> Think the the following text values:
>>> a='12'
>>> b='34'
>>> c='56'
>>>
>>> If you want to update these values to:
>>> a='1'
>>> b='2345'
>>> c='6'
>>>
>>> Then your statement would not update because '123456' = '123456'.
>>
>> You're quite right, but in some cases it's sufficiently faster than doing
>>
>> WHERE a!=1 OR b!=2 OR c!=3
>>
>> that even with the false hits it takes less time to process.
>>
>> Simon.
>> _______________________________________________
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> 
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to