求一条SQL语句,先答对分数全给谁了
INSERT INTO [table]
([FatherID],[SortID],[Title])
VALUES
(1
,这个地方我想是 table 表的总计录数再加1个,SortID是Int型的
,'标题')
我写成这样会报错,请高手指教:
sql insert
INSERT INTO [table]
([FatherID],[SortID],[Title])
VALUES
(1
,(select count(*) from [table])+1
,'标题')
[解决办法]
INSERT INTO [table] ([FatherID],[SortID],[Title])
select 1,count(*)+1,'标题' from [table]