php - MySQL Query to pull items, but always show a certain one at the top -


i have database items entered in they're given section such "books", "dvds", "posters", "accessories", "clothing" etc. each item has section tacked onto it.

here's sql query i'm using find unique sections can use them organize items section.

select distinct section merch 

that gives me correct results, putting unique sections array. now, i'd 2 sections listed first. want "posters" , "books" first , second, show rest of categories.

is there way adjust above query 2 sections shown first, remaining unique categories show below?

select distinct section merch      order field(section, 'books', 'posters') desc; 

Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -