> 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, <[email protected]> wrote: > Yes that works. > But it is ambigous ... > > -----Ursprüngliche Nachricht----- > Von: Igor Tandetnik <[email protected]> > Gesendet: 01.05.2010 16:00:01 > An: [email protected] > Betreff: Re: [sqlite] sqlite update with joins > > [email protected] 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 > [email protected] > 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 > [email protected] > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

