T
T
tigra2016-05-23 14:47:29
MySQL
tigra, 2016-05-23 14:47:29

How to select a specific entry?

aa32c075bc084e7fb2c0a5576e430bb9.png
sorting is applied, I need to pull out the sixth record, not by id, not by name, but by account in the list,
i.e. here I need to get user.password

Answer the question

In order to leave comments, you need to log in

4 answer(s)
T
tigra, 2016-05-23
@tigroid3

what I wanted to get is done like this
SELECT * FROM `table` LIMIT 1 offset 5

M
Maa-Kut, 2016-05-23
@Maa-Kut

There will be something like:
Only you still need to make sure that ORDER BY is correct, otherwise the order of the lines will start to float, and the value will return some other.
In general, tying up in the order of lines and taking exactly the march (third, seventeenth) is very, very strange. It is better to immediately add some additional identifier to the table or somehow correct the logic in order to be tied to WHERE, and not to the row number.

S
Severus256, 2016-05-23
@severus256

Or try to count the record using COUNT()

A
Alex, 2016-05-23
@streetflush

Number the lines, then wrap the select with the desired number.
Select * from
(SELECT @i := @i + 1 AS row_number, your_table.*
FROM your_table, (select @i:=0) AS z )t1 where row_number =6

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question