永发信息网

为什么这个SELECT语句在SQL 2005中不能执行呢?

答案:3  悬赏:40  手机版
解决时间 2021-03-08 11:42
create database bbs;
use bbs;
create table article
(
id int primary key auto_increment,
pid int,
rootid int,
title varchar(255),
cont text,
pdate datetime,
isleaf int
);

insert into article values (null, 0, 1, '蚂蚁大战大象', '蚂蚁大战大象', now(), 1);
insert into article values (null, 1, 1, '大象被打趴下了', '大象被打趴下了',now(), 1);
insert into article values (null, 2, 1, '蚂蚁也不好过','蚂蚁也不好过', now(), 0);
insert into article values (null, 2, 1, '瞎说', '瞎说', now(), 1);
insert into article values (null, 4, 1, '没有瞎说', '没有瞎说', now(), 0);
insert into article values (null, 1, 1, '怎么可能', '怎么可能', now(), 1);
insert into article values (null, 6, 1, '怎么没有可能', '怎么没有可能', now(), 0);
insert into article values (null, 6, 1, '可能性是很大的', '可能性是很大的', now(), 0);
insert into article values (null, 2, 1, '大象进医院了', '大象进医院了', now(), 1);
insert into article values (null, 9, 1, '护士是蚂蚁', '护士是蚂蚁', now(), 0);
最佳答案
create database bbs;
use bbs;
create table article
(
id int primary key identity(1,1),
pid int,
rootid int,
title varchar(255),
cont text,
pdate datetime,
isleaf int
);

insert into article values (0, 1, '蚂蚁大战大象', '蚂蚁大战大象', getdate(), 1);
insert into article values (1, 1, '大象被打趴下了', '大象被打趴下了',getdate(), 1);
insert into article values (2, 1, '蚂蚁也不好过','蚂蚁也不好过', getdate(), 0);
insert into article values (2, 1, '瞎说', '瞎说', getdate(), 1);
insert into article values (4, 1, '没有瞎说', '没有瞎说', getdate(), 0);
insert into article values (1, 1, '怎么可能', '怎么可能', getdate(), 1);
insert into article values (6, 1, '怎么没有可能', '怎么没有可能', getdate(), 0);
insert into article values (6, 1, '可能性是很大的', '可能性是很大的', getdate(), 0);
insert into article values (2, 1, '大象进医院了', '大象进医院了', getdate(), 1);
insert into article values (9, 1, '护士是蚂蚁', '护士是蚂蚁', getdate(), 0);

用这个语句,你写的那个应该是mysql的语法吧
全部回答
你可能没有跳转到有puts这个表的数据库吧!你确定有这个表,先用: sql>use " 你要跳转到的数据库" sql>select * from puts;
id int primary key auto_increment, 这句话不对 不知道你的id要什麼效果,如果是自动产生的序号的话应该是以下写法 id int IDENTITY(1,1) NOT FOR REPLICATION NOT NULL, 并且在insert 的时候是不可以对这个栏位进行新增的.
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
南无阿弥陀佛。 我想结缘一张大幅的阿弥陀佛
对建筑基地的基本要求,下列何者是正确的?()
舒馨家园怎么去啊,有知道地址的么
文泰刻绘阴刻怎么转换成阳刻?
广州到福建多长时间,广州到福建有多远,多少
负强化和惩罚在本质上是相同的。
天元地方侧面积计算公式
大小金川之役的介绍
单价1798满100减去30等于多少,给我个数学公
针织机器上的针数怎么辨认
如图,在半径为R的圆形钢板上,切掉半径为r的
惠州市技师学院怎么去啊,有知道地址的么
加热器化学清洗除垢率95%是指什么
兰姓起源
梦幻西游自己练5个号那五个号好?
推荐资讯
2015年巴萨各体育项目共获得多少冠军
【人耳能听到的声音频率】人耳所能听见的最高
请问,泣求各位达人修罗亲卫F的出处,本人挂罗
我是一个15岁的女生,我的小腿和大腿都很粗,
1983年的炎热秋天,西欧大陆20万民众在100多
函数f(x)=2x-tanx在(-π/2,π/2)上的图像大致
观察右边漫画,回答下列问题: (1)漫画中的
大连心理咨询哪里有
电信电视看一会儿出现系统繁忙错误代码148是
2012年7月电大统计学原理期末考试试题及答案
氨气溶于水之后水体积变么?为什么
黑物业乱收费,当地部门不作为,我应该往哪里
正方形一边上任一点到这个正方形两条对角线的
阴历怎么看 ?