order by number of character in sql

Solutions on MaxInterview for order by number of character in sql by the best coders in the world

showing results for - "order by number of character in sql"
Dave
18 Oct 2018
1You can also sort or order by the Number of Characters in each Column you wish 
2to sort by. Shown below is a sample which sorts by the first three characters 
3of the First Name and by the last two characters in the name of the town.
4
5    SELECT *
6    FROM table_name
7    ORDER BY LEFT(FirstName, 3) ASC, LEFT(Town, 2);