Hello i am having problems with this column data
cities
Charlotte
Cincinnati
Cleves
Columbus
Fairfield
Fresno
Los Angeles -- HERE IS THE PROBLEM
Los Angeles
Madison
Manhatttan Beach
New York
Orange
Palo Alto
Phoenix
Sacramento
San Francisco
Takoma Park -- maybe this city must have problems also
Tarrytown
Valencia
Washington
How i can filter that value, what is the easy way with trim? i did my research but i find long sql statements that i dont understand if that could help is a simple error.
This is the query:
-- 3. Write a query that will list all the cities that have customers with a heading of Cities. Only
-- list each city once (no duplicates) and sort in descending alphabetical order.
select distinct customer_city as cities
FROM customers
ORDER BY customer_city ASC
-- left Los Angeles
select distinct REPLACE(customer_city, ' ', ' ')
. But what aboutLosAngeles
with no space?[NormalizedCityName]
, then copy your values into it and: replace multiple spaces with one space; add space before capitalized letter if it is absent and the letter is not first in the value; maybe something else. Then check this column for duplicates and misprintings (for example, triplet
inManhatttan Beach
). Finally you may check for rows pairs whose Levenstein distance is 1.