MySQL can you use LIMIT to return n rows, but then also return any other row whose value matches the nth row? -


After trying an order I am trying to limit the number of rows returning to the top 5 rows, but I This also requires returning all other rows back, which share the same value as the 5th highest value.

i.e.

  Number of traffic tickets 8 7 7 6 4 4 4 3 2   

8, 7, 7, 6, 4, 4, 4 should be returned because 4 is the fifth value, and the other 4 are 'tied'.

Is it possible to limit such a line in MySQL?

  Select number from drivers serial number by date DESC LIMIT 5 ?????   

Is there anything that you can get some queries that are something to gain in MySQL?

There are a few ways of using this subquery that it uses IN :

  From the drivers to select the number in pneumatic (Choose the number of drivers by Numetix Disks Limit 5) 5.   

You can also use a JOIN :

 . D drivers from d.NumTickets (Select number from driver command by Numetix Disks Limit 5) d.numTickets = D2.NumTickets on D2    

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -