Skip to content

Tag Archives: PostgreSQL-function

While using procedures and functions, PostgreSQL allows us to pass data from the calling program to the procedure or function and to receive data back… Read More
In PostgreSQL CREATE FUNCTION statement to develop user-defined functions. Syntax: create [or replace] function function_name(param_list) returns return_type language plpgsql as $$ declare -- variable declaration… Read More
In PostgreSQL, the Drop function statement is used to remove a function. Syntax: drop function [if exists] function_name(argument_list) [cascade | restrict] Let’s analyze the above… Read More
In PostgreSQL the age() function is used to calculate ages. Syntax: age(timestamp, timestamp); Let’s analyze the above syntax: The age() function accepts two TIMESTAMP values… Read More
In PostgreSQL, the DATE_PART() function is used to query for subfields from a date or time value.  Syntax: DATE_PART(field, source) In the above syntax the… Read More
The PostgreSQL CURRENT_DATE function returns the current date. Syntax: CURRENT_DATE Return value: The CURRENT_DATE function returns a DATE value that represents the current date. Example… Read More
In PostgreSQL, the ROW_NUMBER() function is used to assign a unique integer to every row that is returned by a query. Syntax: ROW_NUMBER() OVER( [PARTITION… Read More
In PostgreSQL, the RANK() function is used to assign a rank to each row of the query result set within the specified partition. The rank… Read More
In PostgreSQL, the NTILE() function is used to divide ordered rows in the partition into a specified number of ranked buckets. Buckets are nothing byt… Read More
In PostgreSQL, the CUME_DIST() function is used to query for the relative position os a value within a set of given values. Syntax: CUME_DIST() OVER… Read More
In PostgreSQL, the LEAD() function is used to access a row that follows the current row, at a specific physical offset and is generally used… Read More
In PostgreSQL, the LAST_VALUE() function returns the last value in an ordered partition of the query result set . Syntax: LAST_VALUE ( expression ) OVER… Read More
In PostgreSQL, the FIRST_VALUE() function is used to return the first value in a sorted partition of a result set. Syntax: FIRST_VALUE ( expression )… Read More
In PostgreSQL, the DENSE_RANK() function is used to assign a rank to each row within a partition of a result set, with no gaps in… Read More
The PostgreSQL EXTRACT() function is used to query for field associated with date and time such as a year, month, and day from a date/time… Read More