Hi,
Sorry, I use mysql, not in sqlite, in mysql ,I run this command, the console 
show this error: do you know why?  
Thank you very much!

mysql> UPDATE adlbk20140520a
    -> SET pflopf = (
    -> SELECT pflopf
    -> FROM adl
    -> WHERE adl.ref = adlbk20140520a.ref)
    -> WHERE (
    -> SELECT COUNT(*)
    -> FROM (
    -> SELECT 1 FROM adl
    -> WHERE adl.ref = adlbk20140520a.ref
    -> LIMIT 2
    -> )
    -> ) = 1;
ERROR 1248 (42000): Every derived table must have its own alias
mysql>

>   Message: 8
>   Date: Mon, 19 May 2014 09:55:25 +0300
>   From: Paul <[email protected]>
>   To: [email protected]
>   Cc: [email protected]
>   Subject: Re: [sqlite] how to write this commands?
>   Message-ID: <[email protected]>
>   Content-Type: text/plain; charset="UTF-8"
>   
>   
>   > 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
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to