Skip to content

Tag Archives: PostgreSQL-function

In PostgreSQL, DATE_TRUNC Function is used to truncate a timestamp type or interval type with specific and high level of precision. Syntax: date_trunc('datepart', field) The… Read More
The PostgreSQL CURRENT_TIMESTAMP() function returns the current date and time with time zone. It is important to note that the time and time zone returned… Read More
The PostgreSQL CURRENT_TIME function returns the current time and the currentthe time zone. Syntax: CURRENT_TIME(precision) Let’s analyze the above syntax: The precision argument is used to… Read More
In PostgreSQL, the substring function is used to extract a substring from a string. Syntax: SUBSTRING ( string, start_position, length ) Let’s analyze the above… Read More
The PostgreSQL SPLIT_PART() function is used to split a string from a specific delimiter and these queries return the nth substring. Syntax: SPLIT_PART(string, delimiter, position)… Read More
The PostgreSQL RIGHT() function is used to query for the last n characters in a string. Syntax: RIGHT(string, n) Let’s analyze the above syntax: The… Read More
In PostgreSQL, the REPLACE function is used to search and replace all occurrences of a string with a new one. Syntax: REPLACE(source, old_text, new_text );… Read More
The PostgreSQL REGEXP_MATCHES() function is used to match a POSIX regular expression against a string and subsequently returns the strings that match the pattern. Syntax:REGEXP_MATCHES(source_string,… Read More
In PostgreSQL, the CONCAT_WS function is used to concatenate strings with a separator. Like the CONCAT function, the CONCAT_WS function is also variadic and ignored… Read More
In PostgreSQL, the CONCAT function is used to concatenate two or more strings into one. Syntax: CONCAT(string_1, string_2, ...) Let’s analyze the above syntax: The… Read More
The PostgreSQL CHR() function is used to convert an integer ASCII code to a character or a Unicode code point to a UTF8 character. Syntax:… Read More
The PostgreSQL ASCII() function is used to derive an an ASCII character. In the case of UTF-8, the ASCII() function returns the Unicode code point… Read More
In PostgreSQL, the LAG() function is used to access a row that comes exactly before the current row at a specific physical offset. The LAG()… Read More
In PostgreSQL, the NTH_VALUE() function is used to get a value from the nth row in a result set. Here is the syntax of the… Read More
In PostgreSQL, the PERCENT_RANK() function is used to evaluate the relative ranking of a value within a given set of values. The syntax of the… Read More