SQL Length ( ) function is used to get the length of the string .
In MySQL : Length ( ) ;
In Oracle : Length ( ) ;
In SQL : Len ( ) ;
Syntax :
select len ( column_name ) from table_name ;
Example :
Table name : Employee_Info
Id Employee_name Employee_Age Employee _Salary
1 Mukesh 23 100000
2 Ayush 24 200000
3 Ishan 20 400000
4 Pranav 35 700000
5 Abhishek 26 800000
6 Ravi 25 300000
7 David 40 800000
Query to get the length of a text field :
select Employee_name , len ( Employee_Age) from Employee_Info ;
Output :
Employee_name Employee_Age
Mukesh 2
Ayush 2
Ishan 2
Pranav 2
Abhishek 2
Ravi 2
David 2
0 Comment(s)