Question
Forcing a specific result set order
I have a query that looks like this
SELECT DISTINCT isSchool_Type + ' (' + CAST(COUNT(1) AS varchar) + ')' AS navtitle, COUNT(1) AS k, null as locate1, null as pageid, 'schools.cfm?schooltype=' + CAST(isSchool_Type AS varchar) + '&' AS thepage
FROM Locations
WHERE (isSchool = 1) AND (isSchool_Type IS NOT NULL)
GROUP BY isSchool_Type
ORDER BY navtitle
isSchool_type can be high, intermediate, middle or elementary. The problem is that I want the result set to be ordered in a specific order (Not alphabetically like it is now.) Is there a way to do this right in the ORDER BY CLAUSE of the SQL statement without having to create a "sortby" column and putting the numbers in.
TIA
SELECT DISTINCT isSchool_Type + ' (' + CAST(COUNT(1) AS varchar) + ')' AS navtitle, COUNT(1) AS k, null as locate1, null as pageid, 'schools.cfm?schooltype=' + CAST(isSchool_Type AS varchar) + '&' AS thepage
FROM Locations
WHERE (isSchool = 1) AND (isSchool_Type IS NOT NULL)
GROUP BY isSchool_Type
ORDER BY navtitle
isSchool_type can be high, intermediate, middle or elementary. The problem is that I want the result set to be ordered in a specific order (Not alphabetically like it is now.) Is there a way to do this right in the ORDER BY CLAUSE of the SQL statement without having to create a "sortby" column and putting the numbers in.
TIA
