new column

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

new column

水静流深
there are tow column x1,x2 in table t ,all real
alter table  t  add  column  c1 real;
select  x1+x2 as  c1 from t;
there ara output in my screen,but in the database,
c1  column has no value,how can i make the value of c1 column =x1+x2?
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: new column

Puneet Kishor-2

On Sep 25, 2011, at 10:53 PM, 守株待兔 wrote:

> there are tow column x1,x2 in table t ,all real
> alter table  t  add  column  c1 real;
> select  x1+x2 as  c1 from t;
> there ara output in my screen,but in the database,
> c1  column has no value,how can i make the value of c1 column =x1+x2?

UPDATE t SET c1 = x1 + x2;

That said, you have a basic misunderstanding of SQL, so some tutorials, many freely available on the internet, would help.

_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users