Having Clause
Description
The HAVING clause specifies an intermediate result table that consists of those groups of R for which the search-condition is true.
Click here to navigate to the IBM DB2 docs page for this syntax.
Grammar Syntax
Sample Source Patterns
Note that the following code is valid in both Db2 and Snowflake.
In order to show an example of the Having Clause, we are going to need a table
Now, let's insert some values into the table.
Suppose we wish to get those values where COL2 equals to 2. We can do it with the having clause
Let's compare the result that this query would return in Db2 and Snowflake.
IBM DB2 | Snowflake |
---|---|
As you can see, both return the same results.
Last updated