select top 1 * from tb where id>(select id from tb where id = 365) order by id asc
解决方案 »
- 用WinFrom做个类似下图的功能 下图为Dev的
- 求C#简单的算法可是我不会求解啊
- c#vs里面如何复制图片
- 请教Just-In-Time(JIT)编译器的问题
- 怎样让一个控件失焦?
- 诚心求教数组存储问题
- 控件CheckedListBox怎么用呵?? 怎样让所有的项都选中或非选中??
- 谁能帮忙, 我开始昏头了..
- this操作数的作用,在线急等
- 我的帖子发出好几天了,请帮忙啊!(见“我想用C#写上传下载的应用....”,加分,在线等待,请帮忙!)
- c# 这个声明怎么写啊?
- 检索 COM 类工厂中 CLSID 为 {8885370D-B33E-44B7-875D-28E403CF9270} 的组件时失败,原因是出现以下错误: 800
select * from T_D where id = (select top1 id from T_D where C1+C2+C3=7)+1
select id from tb where id = 365
条件所得记录不止一行记录
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
insert into @ta
select 'a','123' union all
select 'a2','345' union all
select 'a11','231' union all
select 'a12','12311' union all
select 'a21','12323'select IDEntity(int,1,1) ID,* INTO #temp from @ta where [name] like '%2%'--满足条件数据
select * from #temp--满足条件的第二条
select * from #temp where ID=2drop Table #temp
/*
ID Name title
----------- ---------- --------------------
1 a2 345
2 a12 12311
3 a21 12323(3 行受影响)ID Name title
----------- ---------- --------------------
2 a12 12311(1 行受影响)
*/
select top 1 * from #temp where id not in(select top 12 id from #temp)
select * from (select row_number() over(order by id) as rownumber,* from T_D where C1+C2+C3=7) A where rownumber=13其中id是必须用来排序的。