>
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
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
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
>
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
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
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:
6 matches
Mail list logo