Search
 
SCRIPT & CODE EXAMPLE
 

SQL

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);
Comment

PREVIOUS NEXT
Code Example
Sql :: local database sql 
Sql :: query to find third highest salary 
Sql :: postgresql port 5432 not open 
Sql :: psql shell 
Sql :: max length found in mysql 
Sql :: to show sp in sql server 
Sql :: change password in mysql 
Sql :: insert into postgres 
Sql :: full outer join postgres 
Sql :: Split JSON data in SQL Server column 
Sql :: count weekend days between two dates sql 
Sql :: python connect microsoft sql server 
Sql :: mysql update 
Sql :: mysql replace regex 
Sql :: sql comments 
Sql :: oracle sql developer 
Sql :: insert multiple rows from another table sql 
Sql :: where clause for clob in oracle 
Sql :: Rows, INSERT INTO, Returning 
Sql :: postgresql find missing id 
Sql :: oracle cast boolean to varchar2 
Sql :: many to many flask-sqlalchemy 
Sql :: prisma transaction 
Sql :: create atable copy in pgsql 
Sql :: sql insert into select statement 
Sql :: automatically update database last seen datetime in sql 
Sql :: h2 auto increment and unique 
Sql :: drop procedure postgres 
Sql :: MySql query execution order: 
Sql :: oracle cache matching 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =