If I say:
select max(length(Name)) from my_table
I get the result as 18, but I want the concerned data also. So if I say:
select max(length(Name)), Name from my_table
...it does not work. There should be a self join I guess which I am unable to figure it out.
Can anyone please provide me a clue?
SELECT name, LENGTH(name) AS mlen FROM mytable ORDER BY mlen DESC LIMIT 1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With