SQL QUERY Result arrangement issue

后端 未结 2 1133
半阙折子戏
半阙折子戏 2021-01-18 12:15

This is my SQL query:

select name,description 
from wp_widget_custom 
where name in (\'hemel-hempstead\',\'maidenhead\',
  \'guildford\',\'bromley\',\'east-l         


        
2条回答
  •  南笙
    南笙 (楼主)
    2021-01-18 12:34

    order by field:

    select name, description
    from wp_widget_custom
    where name in ('hemel-hempstead','maidenhead','guildford','bromley','east-london','hertfordshire','billericay','surrey')
    order by field(name, 'hemel-hempstead','maidenhead','guildford','bromley','east-london','hertfordshire','billericay','surrey')
    

提交回复
热议问题