Selecting two specific mysql table rows in a single query
- by Scotta
Lets say I have a table with 20 entries. They are sorted by date (date is a column name _) in descending order. How would I go about selecting ONLY the newest entry and the 15th oldest entry?
I am getting all 15 results by doing the following query
SELECT * FROM mytable m WHERE col1 = "zzz" ORDER BY date DESC LIMIT 15;