I have a table of chemicals in mysql database. I would like to perform a wildcards search like –
SELECT * FROM
chemical where chemical like ‘%toluene%’
SQL query result is –
Chlorotoluene (Benzyl chloride)
Isopropyl toluene (Cymene)
Toluene di-isocyanide (TDI)
Can results with exact matches from the first character of the string (in this case, ‘toluene’) be listed ahead of any other result? For example – I would like to display –
Toluene (Toluol) AND Toluene di-isocyanide (TDI) first and then rest of the results.
Many thanks for your help.