Hi Expert!
I know that I can surface a row in a query by using it in the ORDER BY like this :
SELECT IF(`category` IS NOT NULL,`category`,"Uncategorized") AS `category` FROM `table` ORDER BY `category`="Uncategorized" DESC which will make the first row always contain "Uncategorized", however I have multiple rows that contain it that I also want surfaced. Here are two sample sets of returned data:
What I'm getting:
Uncategorized
Science
Health
Uncategorized
Wellness
What I want:
Uncategorized
Uncategorized
Health
Science
Wellness
I have tried a number of other things including a CASE and also using a conditional IF. What am I doing wrong?
Thanks in advance!
AVADHESH PATEL
18-May-2013