Re: [sqlite] table aliases in update

2012-04-01 Thread Yuriy Kaminskiy
Igor Tandetnik wrote: > Baruch Burstein wrote: >> Does sqlite not support table aliases in update statements? > > Indeed it does not. > >> Is there a way >> to work around this to get the affect of >> >> update table1 t1 >>set col1 = col1 * 2 >>where col1 <=

Re: [sqlite] table aliases in update

2012-04-01 Thread Simon Slavin
On 1 Apr 2012, at 2:24pm, Igor Tandetnik wrote: > Simon Slavin wrote: >> On 1 Apr 2012, at 2:09pm, Baruch Burstein wrote: >> >>> update table1 t1 >>> set col1 = col1 * 2 >>> where col1 <= (select avg(col1) >>>

Re: [sqlite] table aliases in update

2012-04-01 Thread Petite Abeille
On Apr 1, 2012, at 3:21 PM, Simon Slavin wrote: > Can this be done with a JOIN instead of a sub-SELECT ? Not in SQLite, as the join clause is not supported in an update statement. For such functionality, look at MySQL or Postgress which do support variation of such syntax. Something like

Re: [sqlite] table aliases in update

2012-04-01 Thread Igor Tandetnik
Simon Slavin wrote: > On 1 Apr 2012, at 2:09pm, Baruch Burstein wrote: > >> Does sqlite not support table aliases in update statements? Is there a way >> to work around this to get the affect of >> >> update table1 t1 >> >>set col1 = col1 * 2 >>

Re: [sqlite] table aliases in update

2012-04-01 Thread Simon Slavin
On 1 Apr 2012, at 2:09pm, Baruch Burstein wrote: > Does sqlite not support table aliases in update statements? Is there a way > to work around this to get the affect of > > update table1 t1 > >set col1 = col1 * 2 > >where col1 <= (select avg(col1) > >

Re: [sqlite] table aliases in update

2012-04-01 Thread Igor Tandetnik
Baruch Burstein wrote: > Does sqlite not support table aliases in update statements? Indeed it does not. > Is there a way > to work around this to get the affect of > > update table1 t1 >set col1 = col1 * 2 >where col1 <= (select avg(col1) >

Re: [sqlite] table aliases in update

2012-04-01 Thread Petite Abeille
On Apr 1, 2012, at 3:09 PM, Baruch Burstein wrote: > Does sqlite not support table aliases in update statements? Nope, no aliasing in the update itself. > Is there a way > to work around this to get the affect of > > update table1 t1 > >set col1 = col1 * 2 > >where col1 <= (select