跟大家一起学习下SQL的精华,请大家一起帮忙:选择某行到某行的数据

来源:百度知道 编辑:UC知道 时间:2024/06/08 16:53:25
我有一张表 里面有10行数据,简单地说就是a b c d e f g h i j ,我想找出5到7行的数据,我用了以下sql:

select top 5 * from table where not exists ( select top 7 * from table)
哪里有问题呢
2楼的,sql执行出错:关键字 'exists' 附近有语法错误。

问题补充:

这个sql语句从语法是没错,逻辑也没错啊,为什么不出数据呢
-----------------------------
not exists用的方法错,逻辑也错。

select top 3 * from table where Col not in(select top 4 COl from table)

逻辑和语法上是错的。
select top 3 * from table where id not exists (select top 4 id from table )