帮忙看看这个sql怎么写??顺便祝大家新年快乐!

bj890 2009-01-19 12:15:50

A 表总共20条数据

[id] [name]
1 xiao
2 yu
3 m
4 d
. .
. .

第一次查询按id 1,2,3,...20 排序;
第二次查询按id 2,3,4,....20,1 排序;
第三次查询按id 3,4,5.....22,1,2 排序;
....................
sql语句怎么写!!!!!!!
新年快乐
...全文
197 25 打赏 收藏 转发到动态 举报
写回复
用AI写文章
25 条回复
切换为时间正序
请发表友善的回复…
发表回复
jiang_jiajia10 2009-01-19
  • 打赏
  • 举报
回复
1楼的可以
lovehongyun 2009-01-19
  • 打赏
  • 举报
回复
主要是怎么确定是第几次查.如果可以传参的话.就用1楼的办法.
SATAN1122 2009-01-19
  • 打赏
  • 举报
回复
第一个想法是用存储过程``内容同2楼``
malin2670372 2009-01-19
  • 打赏
  • 举报
回复
设置一个查询次数的变量 QueryCount

select * from A
where A.id >= QueryCount
order by id ASC
union
select * from A
where A.id <= QueryCount
order by id ASC



聪明的小孩..
honey52570 2009-01-19
  • 打赏
  • 举报
回复
see see
supremeholy 2009-01-19
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 chinaicm 的回复:]
设置一个查询次数的变量 QueryCount

select * from A
where A.id >= QueryCount
order by id ASC
union
select * from A
where A.id <= QueryCount
order by id ASC
[/Quote]
up!
bj890 2009-01-19
  • 打赏
  • 举报
回复
功能基本实现!
beniao277 2009-01-19
  • 打赏
  • 举报
回复
不懂 支持下.
chinaicm 2009-01-19
  • 打赏
  • 举报
回复
设置一个查询次数的变量 QueryCount

select * from A
where A.id >= QueryCount
order by id ASC
union
select * from A
where A.id <= QueryCount
order by id ASC
Nikoponidis 2009-01-19
  • 打赏
  • 举报
回复
UP
successful_cdr 2009-01-19
  • 打赏
  • 举报
回复
select * from A
where A.id >= QueryCount
order by id ASC
union
select * from A
where A.id <= QueryCount
order by id ASC
cao2cao 2009-01-19
  • 打赏
  • 举报
回复
厉害!来支持
xmycl008 2009-01-19
  • 打赏
  • 举报
回复
JF
kingcsx666 2009-01-19
  • 打赏
  • 举报
回复
很有意思,请问用的那方面啊
dd__dd 2009-01-19
  • 打赏
  • 举报
回复
up
Jerry_hu 2009-01-19
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 chinaicm 的回复:]
设置一个查询次数的变量 QueryCount

select * from A
where A.id >= QueryCount
order by id ASC
union
select * from A
where A.id <= QueryCount
order by id ASC
[/Quote]
up
bj890 2009-01-19
  • 打赏
  • 举报
回复
明天就撤了!!!!!!!!!!!
bj890 2009-01-19
  • 打赏
  • 举报
回复
新年快乐!!!!!!!!!!!!!
kerry030401 2009-01-19
  • 打赏
  • 举报
回复
同1楼
love41349279 2009-01-19
  • 打赏
  • 举报
回复
up
加载更多回复(5)

62,046

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧