ARTICLE AD BOX
"I want to retrieve value of second row."
This question does not make sense to a relational database. In a relational database, there is no intrinsic concept of row order, and therefor there is no such thing as "the first row" or "the 4th row" or whatever.
In a relational database, tables should have one or more keys. A key is a column or combination thereof that are not NULL-able, and that have at most one row for any distinct combination of values. You can then use the key to retrieve rows.
It might be possible that it makes sense to impose a particular order on the rows, after which you could refer to the rows by ordinal position. Ordering is done with ORDER BY, followed by a list of expressions that determine the order, and then a LIMIT clause to specify which "slice" of the result you want to retrieve.
The other answers mention LIMIT, but leave out the ORDER BY clause. This means that you have zero gurantees that whatever is now returned as row #x will be returned next time when you execute that exact same query.
Instead of thinking of rows as having a position, you should think of rows having a key, and use that to retrieve a particular row, like this:
SELECT ... FROM table WHERE column1 = valueor if you have a composite key (multiple columns in the key), like so:
SELECT ... FROM table WHERE column1 = value1 AND column2 = value2 ... AND columnN = valueNIf you really still want to use positions, be sure to use the ORDER BY to impose an order:
SELECT ... FROM table ORDER BY column1, ..., columnN LIMIT <offset>, <count>Where is an integer literal that specifies the ordinal position, and is an integer literal that specifies how many rows to fetch starting from the position.
