怎么发了2遍啊
select a from
(
select a,(select count(a) from table where a<a.a) as id
from table a) b
where a<=4
a
--
1
2
3
3
4
select a from
(
select a,(select count(a) from table where a<a.a) as id
from table a) b
where a<=4
a
--
1
2
3
3
4
至于order by只不过是根据所取得的结果进行再次排序,不会等同于where.—————————————————————————————————
┏━★━━◆━━★━┓
♂欢|◢CSDN◣|使♂ ▲自由保存帖子,浏览,关注检测
┃迎|◥论坛助手◤|用┃ ▲完善的CSDN客户端工具
┗━☆━━◇━━━☆┛ ▲自动添加签名......让你更快,更爽,更方便地上CSDN...
http://www.csdn.net/expert/topic/573/573604.xml
http://www.chinaok.net/csdn/csdn.zip