- Impact
- 16
Hey guys,
I am trying to run a SQL command:
SELECT * FROM businesses WHERE website !='' ORDER BY company_name ASC;
SELECT * FROM businesses WHERE website ='' ORDER BY company_name ASC;
But I want this to be one SQL statement. Basically, I want to select businesses that have a website and order by company, then after order by company that does not have a website.
I don't want to do:
SELECT * FROM businesses ORDER BY website DESC, company_name ASC; because then it sorts by website reverse alphabetical.
Does this make sense? Any help would be great.
Thanks,
Shaun
I am trying to run a SQL command:
SELECT * FROM businesses WHERE website !='' ORDER BY company_name ASC;
SELECT * FROM businesses WHERE website ='' ORDER BY company_name ASC;
But I want this to be one SQL statement. Basically, I want to select businesses that have a website and order by company, then after order by company that does not have a website.
I don't want to do:
SELECT * FROM businesses ORDER BY website DESC, company_name ASC; because then it sorts by website reverse alphabetical.
Does this make sense? Any help would be great.
Thanks,
Shaun





