My MySQL has a time table with min and sec columns in which numbers are stored. The user enters two numbers (for example, min1 and sec1).
Please tell min <= min1 how to create a query in SQL that would select from the time table only the entry with min <= min1 and sec <= sec1 , while this entry has the maximum min that satisfies the condition (and if there are several such entries, then a record with a large sec satisfying the condition.)
Those. speaking Russian, I need to make sure that the maximum time ( min and sec ) that is less than the value entered by the user is selected from the table.
tableWHEREmin<= 'min1' ANDsec<= 'sec1' ORDER BYminDESC,secDESC LIMIT 1 - Indifferent