Jump to: navigation, search

PostgreSQL CHAR LENGTH

From w3cyberlearnings

Contents

Postgresql char_length

Returns the number of characters in string.

Syntax char_length

char_length(string)

Example 1

test2=# SELECT char_length('abc');
 char_length 
-------------
           3
(1 row)

test2=# SELECT char_length('apple');
 char_length 
-------------
           5
(1 row)

Example 2

test2=# SELECT user_firstname,
test2-# char_length(user_firstname)
test2-# FROM profile;
 user_firstname | char_length 
----------------+-------------
 Jim            |           3
 king           |           4
 Jammi          |           5
 Bob            |           3
                |            
(5 rows)

Related Links


Navigation
Web
SQL
MISC
References