I have a database where as items are entered in they’re given a section such as “books”, “dvds”, “posters”, “accessories”, “clothing” etc. So each item has a section tacked onto it.
Here’s the SQL query I’m using to find the unique sections so we can use them to organize the items by section.
SELECT DISTINCT section FROM merch
That gives me the correct results, putting the unique sections into an array. Now, I’d like for two sections to always be listed first. So I always want “posters” and “books” first and second, then show the rest of the categories.
Is there a way to adjust the above query so that those two sections are shown first, then the remaining unique categories show up below?
1 Answer