How can I sort into MySQL in AlphaNumeric order;
Suppose I have a table with data like this.
Name + ID
AA | 10
AE | 2
AD | 1
When I sort column ID the result is
1
10
2
But when I add + 0 in select statement like this for column id
SELECT * FROM tableName ORDER BY columnName + 0;
1
2
10
But the result for column Name is this
AA
AE
AD
I already refer to this link but it doesn't work for me. Alphanumeric Order By in Mysql
Note: All column type is varchar and I cannot predict what data will be inserted. I know my problem is simple but still I can't get the result I want. Also I cannot use Java to sort the result because I use LIMIT on it. I'll appreciate any help.Thanks
Additional Info: (Sample Table to be sorted base on Name and ID) The header1 is the Name which set to another table and same with header2 w/c is ID
CREATE TABLE IF NOT EXISTS `sort` (
`header1` varchar(200) DEFAULT NULL,
`header2` varchar(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `sort` (`header1`, `header2`) VALUES
('AA', '10'),
('AE', '2'),
('AD', '1'),
('AD', '1'),
('AF', 'a'),
('AF', 'a1'),
('1', 'a1');