0
我期待將數據插入一列像這樣:如何使用SQLite表的默認值?
INSERT INTO Song values (null, 'Truth of a Liar')
爲建立這樣一個表:
CREATE TABLE Song (id integer primary key, name varchar(255), count int not null default 0)
,我得到以下錯誤:table Song has 3 columns but 2 values were supplied INSERT INTO Song2 values (null, 'Truth of a Liar')
我因爲我偶爾可能不得不投入count
的價值,所以期待能夠不放在最後一列。我知道我可以明確地填寫這樣的列如下:
INSERT INTO Song(id, name) values (null, 'msdads')
但我希望有一個替代方案。
是否有另一種方式將INSERT
數據轉換爲表格,使用一些默認值和一些設置值?
好的,這似乎基本夠用了,只需像手動那樣輸入默認值即可。 – TankorSmash 2012-07-23 04:26:21