COUNT function returns the count of number of rows returned by a sql query. Syntax to return the number of
Continue readingCategory: Postgresql
PostgreSQL – DISTINCT Clause
A DISTINCT clause is used in the select statement to return only the distinct values from a data set. Consider
Continue readingPostgreSQL – WHERE Clause
A WHERE clause is used in a Select statement to filter the results based on conditions specified in the ‘WHERE’
Continue readingPostgreSQL – FROM Clause
In SQL, FROM clause is used in the select statement to list the tables from which the data is being
Continue readingPostgreSQL – SELECT Statement
SELECT statement is used to retrieve data from the database. In it’s basic form, a select statement looks as shown
Continue readingPostgreSQL – SUM Function
SUM function is an aggregate function that allows you to get the sum of values. Example: Consider the employee table
Continue readingPostgreSQL – LIMIT Clause
In Postgres, you can use ‘LIMIT’ clause to return only a certain number of rows by a query. Syntax: SELECT
Continue readingPostgreSQL – ORDER BY Clause
An ‘ORDER BY’ clause is used in the select statement to sort the result set in either ascending or descending
Continue readingPostgreSQL – DISTINCT ON clause
In Postgres database, you can use DISTINCT ON to select one row per group. Consider the below employee table; where
Continue readingPostgresql – how to declare a variable
Syntax: A variable declaration requires a variable name and a data type. Example: You can optionally specify a default value
Continue reading