sql - ADD vs. ADD COLUMN in SQLite? -
i trying add new column pre-existing table on database upgrade method. i've seen 2 ways:
alter table foo add new_column integer default 0
and
alter table foo add column new_column integer default 0
what's difference?
the column
keyword optional. no difference @ all.
try following script:
create table test ( col1 integer ); insert test (col1) values (1); alter table test add col2 integer null; alter table test add column col3 integer null; select * test
the result be:
col1 col2 col3 1
Comments
Post a Comment