SQL语法里怎么表示 10到20的数据 在线等

来源:百度知道 编辑:UC知道 时间:2024/05/15 11:30:39

select * from (select rownum r,t1.* from(select * from tablename) t1)
where r<=20 and r>=30;

between 10 and 20
例如查询student表里学习成绩(mark字段)10到20之间的学生编号(id字段)
select id from student where mark between 10 and 20

在线,应该是有个列来表示他在不在线,比如他是等0的时候为在线。
你的查询中就可以写个where 列名 = 0;
select * from table where 列名=0 and 数据列列名 between 10 and 20

2 楼的应该可以的