MySql Query, Select greater than

后端 未结 4 2260
我在风中等你
我在风中等你 2021-02-20 03:26

I\'ve got a table, called faq_questions with the following structure:

id int not_null auto_increment,
question varchar(255),
sort_order int

I\'

4条回答
  •  时光取名叫无心
    2021-02-20 04:08

    It seems too simple, but it looks like what you need:

    SELECT id,question FROM `questions` 
    WHERE `sort_order` > sort_order_variable
    ORDER BY sort_order ASC 
    LIMIT 1
    

提交回复
热议问题