Skip to content
Advertisement

Order a MySQL query by fastest response time

I have a SQL query:

But my goal is to have only one of the number and it should be this one with the lowest FRMins. I tried it in many different ways, but I don’t get it right.

It should look like this one

Advertisement

Answer

You can use WHERE EXISTS (SELECT ... GROUP BY ... HAVING) subquery to get the distincts numbers having the lowest FRMins :

Schema (MySQL v5.7)


Query #1

Output :


View on DB Fiddle

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement