SQL QUERY Result arrangement issue
mysql, sql
Solution
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')
Problem
This is my SQL query: ``` select name,description from wp_widget_custom where name in ('hemel-hempstead','maidenhead', 'guildford','bromley','east-london','hertfordshire','billericay','surrey') ``` The result I am getting is in this form: ``` name description hemel-hempstead Loreum ipsim east-london Loreum ipsim bromley Loreum ipsim BROMLEY billericay Loreum ipsim maidenhead Loreum ipsim maidenhead hertfordshire Loreum ipsim HERTFORDSHIRE guildford loreum ipsum Guildford surrey loreum ipsum surrey ``` I want the result to be arranged the way it was passed in the query: ``` hemel-hempstead ,maidenhead',guildford,bromley,east-london...... ``` Help is appreciated, thanks.