Oracle allows to assign an alias to a table in an update-statement like

update T x
   set x.col = .....

in my eyes thats clear syntax.

so there is a better way.
I would prefer that syntax. Sqlite should have implemented that.

Simon

-----Ursprüngliche Nachricht-----
Von: Pavel Ivanov <paiva...@gmail.com>
Gesendet: 02.05.2010 04:53:17
An: General Discussion of SQLite Database <sqlite-users@sqlite.org>
Betreff: Re: [sqlite] sqlite update with joins

> But it is ambigous ...

It is not ambiguous when you know how SQL works and it's the only
standard way of doing such things.


Pavel

On Sat, May 1, 2010 at 1:31 PM,  <wdl...@web.de> wrote:
> Yes that works.
> But it is ambigous ...
>
> -----Ursprüngliche Nachricht-----
> Von: Igor Tandetnik 
> Gesendet: 01.05.2010 16:00:01
> An: sqlite-users@sqlite.org
> Betreff: Re: [sqlite] sqlite update with joins
>
> wdl...@web.de wrote:
>> The general problem with this issue is that it is not possible
>>
>> to set an alias for the table in an update statement.
>> That should be implemented because otherwise some necessary statements are 
>> not possible.
>>
>> e.g.
>>
>> update T x
>>  set x.col1 = ( select  sum(c) from T y where y.id = x.id )
>
> update T set col1 = (select sum(c) from T y where y.id = T.id);
>
> Try it, it works. Identifier T binds to the first mention of the table, which 
> happens to be the one in the outer UPDATE statement. Other instances of T may 
> be referred to with aliases.
> --
> Igor Tandetnik
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> ___________________________________________________________
> NEU: WEB.DE DSL für 19,99 EUR/mtl. und ohne Mindest-Laufzeit!
> http://produkte.web.de/go/02/
> _______________________________________________
> 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
___________________________________________________________
GRATIS: Movie-Flat mit über 300 Top-Videos. Für WEB.DE Nutzer
dauerhaft kostenlos! Jetzt freischalten unter http://movieflat.web.de
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to