select Field_Content,ID*1 as ID,[index]=identity(int,1,1) into #temp from user_Pro where categoryid=" + id+" order by indexid desc; select * from #temp; drop table #temp";

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/06 21:15:53
select Field_Content,ID*1 as ID,[index]=identity(int,1,1) into #temp from user_Pro where categoryid=

select Field_Content,ID*1 as ID,[index]=identity(int,1,1) into #temp from user_Pro where categoryid=" + id+" order by indexid desc; select * from #temp; drop table #temp";
select Field_Content,ID*1 as ID,[index]=identity(int,1,1) into #temp from user_Pro where categoryid=" + id+" order by indexid desc; select * from #temp; drop table #temp";

select Field_Content,ID*1 as ID,[index]=identity(int,1,1) into #temp from user_Pro where categoryid=" + id+" order by indexid desc; select * from #temp; drop table #temp";
一段sql语句是存储过程中的一个部分.
选择 在 user_pro 表中 类别id=id 的 字段内容 ID 检索 ,并把结果按照检索id 的顺序存到临时表#temp 中
从临时表将所有的字段的内容读出,并将临时表删除