Answers for "sort sql by string"

SQL
5

how to sort names in alphabetical order in sql

SELECT id,  
    first_name,
    last_name, 
  FROM customer
  ORDER BY last_name ASC;
Posted by: Guest on December-21-2020
0

order by number of character in sql

You can also sort or order by the Number of Characters in each Column you wish 
to sort by. Shown below is a sample which sorts by the first three characters 
of the First Name and by the last two characters in the name of the town.

    SELECT *
    FROM table_name
    ORDER BY LEFT(FirstName, 3) ASC, LEFT(Town, 2);
Posted by: Guest on October-01-2021

Code answers related to "SQL"

Browse Popular Code Answers by Language