Thursday, August 13, 2015

How to Count how many characters in Field in mysql using CHAR_LENGTH() function

SELECT PHONE, CHAR_LENGTH(PHONE) AS 'Charather Size' FROM user_details WHERE CHAR_LENGTH(PHONE)>10;

+------------------------------+------------------+
| PHONE                        | Charather Size   |
+------------------------------+------------------+
| 08686501615         |               11 | 
| 918143716151              |               12 | 
+------------------------------+------------------+
2 rows in set (0.00 sec)