How to get next highest number from mysql rows, given one row id.
Categories | sort_order Animal | 400 Cars | 500 > Vans | 550
Now I want to add a category under Cars, over Vans which I have to check what is next highest number after 500.
So when I add 400 should return 500, when 500 should retrun 550.
Should be as simple as the following:
SELECT MIN(sort_order) FROM mytable WHERE sort_order > 500;
Answered By – David Faber
Answer Checked By – Senaida (BugsFixing Volunteer)