M
M
mazahakas2015-01-04 22:58:24
MySQL
mazahakas, 2015-01-04 22:58:24

I can't write sql query, how can I do it?

There is a MySQL table with fields “ID”, “prod”. Write an SQL query that will return the Prod field of the record with the fifth largest ID from the end (for example, if the table records with ID = 1,2,3,6,7,8,10,25,31,32 need entry for ID=8).

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Lerg, 2015-01-04
@Lerg

Homework? Read the manual.

S
Sergey Ozeransky, 2015-01-04
@KREGI

SELECT 'prod' 
FROM  'table' 
ORDER BY 'table'.'id'  DESC
LIMIT 4 , 1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question