The most intelligent Java IDE
[Logo] JavaRanch » JavaRanch Saloon
  Search | FAQ | Recent Topics | Hot Topics
Register / Login


Reply Bookmark it! Watch this topic JavaRanch » Forums » Java » JDBC
 
RSS feed
 
New topic
Author

sql for select intermediate rows

Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Messages: 330

there are 10 rows in student tablei need to get 5 th and 6 th rows.
1)how can i get these rows using select query
2)is there any other way to get other than select query?
Deepak Bala
Bartender

Joined: Feb 24, 2006
Messages: 4871

Use Rownum or equivalent

What database is this

SCJP 6 articles - SCJP 5/6 mock exams - SCJP Mocks - SCJP 5 Mock exam (Word document ) - SCJP 5 Mock exam in Java.Inquisition format
Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Messages: 330

MySql ?
Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Messages: 330

i think we can't use rownum to get middle records?
harilal ithikkat
Ranch Hand

Joined: Oct 06, 2008
Messages: 202



This will display the first 10 results from the database.


This will show records 6, 7, 8, 9, and 10

SCJP 1.5
"A candle looses nothing by lighting another candle"
 
 
 
Reply Bookmark it! Watch this topic JavaRanch » Forums » Java » JDBC
 
RSS feed
 
New topic
MyEclipse Enterprise Workbench