• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

to get 2nd row from table

 
padmaratna kamble
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello friends
please tell me
how to select 2nd and 3rd row from any table
please give me query in detail
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65342
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"padmaratna",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
JavaRanch Sheriff
 
stu derby
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by padmaratna:
hello friends
please tell me
how to select 2nd and 3rd row from any table
please give me query in detail


No such thing. The tables in a relational database represent an unordered set. You have to supply the ordering yourself. Once you supply the ordering, then you can get a particular row in that ordering.

On Oracle and some other databases, to get the 3rd row for some ordering, you could do something like:



Some people are confused because many databases will initially return rows to you in the order they were inserted; however, after some time (particularly after deletes, or updates that make VARCHAR values significantly bigger), the database will reuse or reorganize the internal storage and the "storage order" becomes more or less random.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic