sqlite 中
CREATE TABLE table1 (
id integer primary key autoincrement,
name text default '',
[index] integer default ROWID
)
有没有类似的功能,让 index 的值默认等于id,比如
insert into table1 (id,name) values (null,'第一行');
insert into table1 (id,name) values (null,'第二行');
我希望结果是
id name index
1 第一行 1
2 第二行 2
能实现吗?
一定要用到触发器和存储过程吗?不能直接设置成默认值吗
呵呵,不能,测试了一下不行
嗯,知道了,果然是不行的
测试可以这样 :
insert into table1c values (null,'第一行',(select rowid from table1c));
相关问答:
环境:QNX 6.3.2
版本:SQLite 2.7.3
现象:在命令行下sqlite进去,执行.table、pragma之类、select都提示
database is locked
奇怪的是,即使是新创建一个数据库,执行上述命令也是那样。
另:在一台完 ......
刚入门 想实现新闻表新闻置顶的功能
select * from web_news order by id desc limit 0,6
web_news 表里有TOP列 怎样让TOP列记录为1的为置前 各位大大们帮帮忙 分不多 请包涵!!
order ......
用的是sqllite3,请问在linux先如何用C语言导出数据库啊?
"导出数据库"是是什么?
将 tab_xx 中的数据导出到文件a.txt
sqlite> .output a.txt
sqlite> select * from tab_xx;
sqli ......
目前在公司的linux pc上有一个SQLite server, 我想用在同个区網底下的win pc去连接SQLite server用ASP進行操作, 请问有办法办到吗? 还是SQLite server无法支持网络连接....找了一个下午
剛 ......