COUNT function returns the count of number of rows returned by a sql query. Syntax to return the number of
Continue readingPostgreSQL – 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 readingHow to use OFFSET in Redshift Database
In Redshift database, an OFFSET clause is used to skip the first ‘n’ number of rows specified by offset clause
Continue readingHow to get Date from Timestamp in Redshift Database
TRUNC function can be used to extract date from the timestamp. sysdate returns current date with timestamp as shown below:
Continue reading