I have a table with one of the columns is of type varchar(city). and want to find the longest and shortest of values stored in that column.
select a.city, a.city
Shortest:
select city, char_length(city) city_length from station order by city_length, city limit 1;
Longest:
select city, char_length(city) city_length from station order by city_length desc, city limit 1;