Testcase_id in my system are varchar and generated by trigger and I want to sort them on basis of the integer value of the varchar id . I have been so far used three queries but not working at all. I have also tried with the function which converts string to integer. Here I am mentioning that function also and my query well in this query i have not used function.
select t.Testcase_id,
CONVERT(SUBSTRING_INDEX('t.Testcase_id','_',2),UNSIGNED INTEGER) as num
from testcase_master t
order by num
output(of query):