php - How to prefer prefix over a general "like" result? -


so let's have following columns selected when use %un% like search:

fun unlikely mundane 

but want prefixed results show first - basically, returned in following order:

unlikely fun mundan 

is there simple way in mysql, or have modify array of results after them in php?

i going on php side, although i'm not sure if there's mysql way of doing it.

you add

order left (column,2) = 'un' desc  

that put them @ top


Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -