> UPDATE adla1 
> SET pflopf = (
> SELECT pflopf 
> FROM adl 
> WHERE adl.ref = adla1.ref) 
> WHERE (
> SELECT COUNT(*) 
> FROM (
> SELECT 1 FROM adl 
> WHERE adl.ref = adla1.ref 
> LIMIT 2
> )
> ) = 1;
> 
> Not all sure what LIMIT 2 does there. I think a SQL-92 version
> would be
> 

Limit, limits number of rows selected by ref. If we have found 2, no need to 
lookup further.
That's why it was said to be a slightly optimized version. Generally this saves 
some disk reads.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to