PostgreSQL BIT_LENGTH() function
BIT_LENGTH() function
The PostgreSQL bit_length function is used to count the number of bits in a specified string.
Syntax:
bit_length (str1)
Parameters:
Name | Description |
---|---|
str1 | A string whose BIT_LENGTH value is to be retrieved. |
PostgreSQL Version: 9.3
Pictorial Presentation of PostgreSQL BIT_LENGTH() function
Example: PostgreSQL BIT_LENGTH() function
The following PostgreSQL statement will return the length of the given string 'w3resource'' in bits, i.e. 80.
Code:
SELECT bit_length('w3resource') AS "bit_length";
Sample Output:
bit_length ------------ 80 (1 row)
Previous: PostgreSQL String Functions Introduction
Next: CHAR_LENGTH function
- New Content published on w3resource:
- HTML-CSS Practical: Exercises, Practice, Solution
- Java Regular Expression: Exercises, Practice, Solution
- Scala Programming Exercises, Practice, Solution
- Python Itertools exercises
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework
- Angular - JavaScript Framework
- Vue - JavaScript Framework
- Jest - JavaScript Testing Framework