I'm pulling a list of all cities in a table by using this SQL below:
SELECT DISTINCT CITY FROM LOCATION
ORDER BY CITY;
But what i'm trying to do is to be able to extract all cities where the 13 first characters are the same on 2 different city names.
If i have a city named: BARRINGTON PASSAGE NORTH and also a city name called: BARRINGTON PASSAGE SOUTH.
The 13 first characters on both cities are: BARRINGTON PA
I need to pull all those different cities with the same 13 first chars.
In the first column, it would give me the full city name and in column 2 the 13 first characters.
Than it would order the column by the 13 chars column.
How can i do that?