S
SpookiePower
I have a table TReport which have a field called vcHeader.
In vcHeader is mention 3 different city names and some other text.
I now want to count how many time each city is in the table
and sort by how many times they are mention.
I know how to search for one city, like this -
SELECT count(*) AS Cities
FROM TReport
WHERE vcHeader Like '*NameOfCity*';
and a result like this -
Cities HowManyTimes
A 99
B 66
C 33
But I'm all out of ideas, how to do it.
In vcHeader is mention 3 different city names and some other text.
I now want to count how many time each city is in the table
and sort by how many times they are mention.
I know how to search for one city, like this -
SELECT count(*) AS Cities
FROM TReport
WHERE vcHeader Like '*NameOfCity*';
and a result like this -
Cities HowManyTimes
A 99
B 66
C 33
But I'm all out of ideas, how to do it.