PostgreSQL Having Clause

Having Clause is used to Filter The Records Syntax:- SELECT Column1, aggregate_function(Column2) FROM TABLE GROUP BY Column1 HAVING CONDITION; Let’s Filter the Records using Having Clause. Without Group by , we cant use Having Clause Happy Queries, Thanks…

PostgreSQL GROUP BY Clause

Group by Clause is used to break the data into Groups. Syntax:- SELECT Column1, aggregate_function(Column2) FROM TABLE GROUP BY Column1; employees is the table, that i’m going to use. here making department_id columns records into groups. select department_id, using count aggregate function on department_id making department_id in groups. using max aggregate function on salary for […]

Order by Clause in PostgreSQL

Order by clause is used to sort the columns records in Ascending or Descending Order. Lets see the example : – After Sorting first _name in Ascending Order Sorting Salary Column records in Descending order Sorting records of two columns, First_Name and Last_Name