When we retrieve data from table in SQL Queries, and want to select second, third,........rows from table, then what is the coding of that program?

Showing Answers 1 - 13 of 13 Answers

Sai

  • Sep 9th, 2006
 

You can use ROWID

  Was this answer useful?  Yes

dev

  • Sep 13th, 2006
 

Hi,

Try this one.

select * from employee where rownum<=3
minus
select * from employee where rownum<=1

with this u can retrieve 2nd and 3rd rows only.

  Was this answer useful?  Yes

anil

  • Oct 11th, 2006
 

Dev,

According to you specified querry.. i am not able to fetch 2 & 3 rows from table.(i am using winsql).

select * from employee where rownum<=3
minus
select * from employee where rownum<=1

showing error: 

Error: SQL0104N An unexpected token "minus" was found following "AILS where rownum<=3"

  Was this answer useful?  Yes

dev

  • Oct 17th, 2006
 

HI Anil,

i don't know Winsql. but my query will works in SQL *plus.

thanks.

Dev.

  Was this answer useful?  Yes

sau326

  • Jul 18th, 2010
 

SELECT TOP 2 employeenumber FROM employees WHERE employeenumber NOT IN(SELECT TOP 1 employeenumber FROM employees)


Regards,
Saurabh

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions