How can I select QuestionId in the next row via stored procedure?
(Client side: a question(QuestionId:3) will be shown on screen. When next button is clicked, next question(QuestionId:7) will be shown).
Note that;
QuestionId has to be changed incrementally and continuously according to RowId after every execution(like 1-3-7-8…). Also any question can be deleted so it is important to keep the order.
+-------+------------+--------------+
| RowId | QuestionId | QuestionText |
+-------+------------+--------------+
| 1 | 1 | aaaa |
| 2 | 3 | bbbb |
| 3 | 7 | cccc |
| 4 | 8 | dddd |
| 5 | 13 | eeee |
| 6 | 17 | ffff |
| 7 | 24 | gggg |
| 8 | 30 | hhhh |
+-------+------------+--------------+
Try this:
Clicking the “Next” button should pass the current question ID to the stored procedure.