91-9990449935 0120-4256464 |
PostgreSQL Having ClauseIn PostgreSQL, HAVING clause is used in combination with GROUP BY clause to pick out particular rows where the function's result meets some condition. Syntax: See this example: Let's take a table "EMPLOYEES" having the following data. See this example, which would display record for which name count is less than 2. Execute the following query: Output: Example2:Let's insert some duplicate records in the "EMPLOYEES" table. Add the following data: Output: Execute the following query to retrieve the name from table "EMPLOYEES" where name count is greater than 1. Output:
Next TopicPostgreSQL Conditions
|