I have this table and need to pic the city with the max length and min length.
In this query Im trying to get the max length
select x.name, x.len from
(select name, char_length(name) as len
from tutorials.city) x
where x.len = (select max(x.len) from x)
This query works with aggregator in where clause -
select x.name, x.len from
(select name, char_length(name) as len
from tutorials.city) x
where x.len = (select max(id) from tutorials.city)