Re: [sqlite] how to add a new column quickly

2007-05-07 Thread ronggui wong
> To: <sqlite-users@sqlite.org> Sent: Saturday, May 05, 2007 8:09 PM Subject: Re: [sqlite] how to add a new column quickly > On Sat, May 05, 2007 at 19:30:59 +0800, ronggui wong wrote: >> Thanks. But there is no typo, what I want is a general solution. >> >> 2007/5/5, To

Re: [sqlite] how to add a new column quickly

2007-05-06 Thread Mohd Radzi Ibrahim
How about this? update tablename set newcolname=(case rowid when 1 then 1 else 2 end); best regards, Radzi - Original Message - From: "Tomash Brechko" <[EMAIL PROTECTED]> To: <sqlite-users@sqlite.org> Sent: Saturday, May 05, 2007 8:09 PM Subject: Re: [sq

Re: [sqlite] how to add a new column quickly

2007-05-05 Thread Tomash Brechko
On Sat, May 05, 2007 at 19:30:59 +0800, ronggui wong wrote: > Thanks. But there is no typo, what I want is a general solution. > > 2007/5/5, Tomash Brechko <[EMAIL PROTECTED]>: > >On Sat, May 05, 2007 at 14:01:56 +0800, ronggui wong wrote: > >> . update tablename set newcolname=1 where ROWID=1 >

Re: [sqlite] how to add a new column quickly

2007-05-05 Thread ronggui wong
Thanks. But there is no typo, what I want is a general solution. 2007/5/5, Tomash Brechko <[EMAIL PROTECTED]>: On Sat, May 05, 2007 at 14:01:56 +0800, ronggui wong wrote: > . update tablename set newcolname=1 where ROWID=1 > . update tablename set newcolname=2 where ROWID=2 > . update tablename

Re: [sqlite] how to add a new column quickly

2007-05-05 Thread Tomash Brechko
On Sat, May 05, 2007 at 14:01:56 +0800, ronggui wong wrote: > . update tablename set newcolname=1 where ROWID=1 > . update tablename set newcolname=2 where ROWID=2 > . update tablename set newcolname=2 where ROWID=3 > . > > My question is: how to add the above task efificiently? Thanks! If

[sqlite] how to add a new column quickly

2007-05-05 Thread ronggui wong
I would like to add a new column to an existing table. I use .alter table tablename add newcolname to add a new col, and use . update tablename set newcolname=1 where ROWID=1 . update tablename set newcolname=2 where ROWID=2 . update tablename set newcolname=2 where ROWID=3 . My question is: