如何在表格中间打印要求的行?

时间:2018-11-20 07:20:35

标签: sql

表格输入:

NAME    ID  COURSE YEAR
arun    1   mca 1
anil    2   mca 1
sudheer 3   mca 2
santosh 4   mca 2
arun    1   cse 1
sunil   2   cse 1
raj 3   cse 1
naveen  4   cse 1
venki   5   cse 2
prasad  6   cse 2
sudha   7   cse 2
ravi    1   mech    1
raju    2   mech    1
roja    3   mech    1
anil    4   mech    2
rani    5   mech    2
anvith  6   mech    2
madhu   7   mech    2
arun    1   it  3
sunil   2   it  3
raj 3   it  3
naveen  4   it  3
venki   5   it  4
prasad  6   it  4
sudha   7   it  4
ravi    1   ece 3
raju    2   ece 3
roja    3   ece 3
anil    4   ece 4
rani    5   ece 4
anvith  6   ece 4
madhu   7   ece 4

我需要像下面的示例一样打印中间行

naveen  4   cse 1
venki   5   cse 2
prasad  6   cse 2
sudha   7   cse 2
ravi    1   mech 1
raju    2   mech 1
roja    3   mech 1

2 个答案:

答案 0 :(得分:0)

考虑到它是MySQL:

SELECT * FROM table_name LIMIT start,end;

替换开始,以开始编号和结束编号结束。

答案 1 :(得分:0)

Select * from Your_table Where rownum between START and END;

使用要作为输出的行号更改START和END。