suttercain Posted April 4, 2009 Share Posted April 4, 2009 Hi everyone. I have a table which has, for simplistic reasons, 5 rows of numbers. The numbers are as follows: 1, 2, 3, 7, 8. Let's say I'm at the row with the number 3, how would I tell it to select the next number, in this case 7? I know how to do it in increments of one, but how can I do it, if the numbers are not consistent with the increment of one? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/152603-select-next-higest-number-from-a-column/ Share on other sites More sharing options...
ted_chou12 Posted April 5, 2009 Share Posted April 5, 2009 SELECT field1 FROM tablename WHERE id = ($currentId + 1) Quote Link to comment https://forums.phpfreaks.com/topic/152603-select-next-higest-number-from-a-column/#findComment-801457 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.