In MySQL I have a table named custom_meta where I am getting the values like
id meta_value
1 USNEWYORK01
2 USNEWYORK02
3 USNEWYORK03
4 USNEWYORK04
5 USNEWYORK05
6 USNEWYORK06
7 USNEWYORK07
8 USNEWYORK10
9 USNEWYORK14
10 USNEWYORK16
11 USNEWYORK20
12 USNEWYORK21
13 USNEWYORK32
14 USNEWYORK45
15 USNEWYORK56
16 USNEWYORK78
17 USNEWYORK68
18 USNEWYORK69
19 USNEWYORK80
20 USNEWYORK90
21 USNEWYORK99
22 USNEWYORK100
23 USNEWYORK45
24 USNEWYORK101
Now I want to get the meta_value with highest number. So in the table you can see the highest one is USNEWYORK101
. So to get that I have made query like this
SELECT meta_value from custom_meta ORDER BY meta_value DESC LIMIT 1
But it is getting USNEWYORK99
always. I have tried to use CAST
also but that is also not working.
So can someone help me to get this done? Any suggestions and advice would be really appreciable.
Thanks.