I have the following table:
CREATE TABLE Bable
(
id int identity primary key,
name varchar(20),
about varchar(30)
);
INSERT INTO Bable (name,about) VALUES
(' Name Firm 1','texttexttexttext'),
(' Name Firm 2','texttexttexttext'),
(' Name Firm 3','texttexttexttext'),
(' Name Firm 4','texttexttexttext'),
(' Name Firm 5','texttexttexttext'),
(' Name Firm $1','texttexttexttext'),
(' Name Firm $2','texttexttexttext'),
(' Name Firm $3','texttexttexttext'),
(' Name Firm 6','texttexttexttext'),
(' Name Firm 7','texttexttexttext')
And I can write a query like the following:
SELECT * FROM Bable WHERE about = 'texttexttexttext'
How can I modify this query to return results ordered so that first names with names containing "$" are displayed, and then those that do not, each group being sorted namein ascending order?
Table structure here
source
share