| org.hsqldb.test.TestGroupByHaving
TestGroupByHaving | public class TestGroupByHaving extends TestCase (Code) | | Test cases for HSQL aggregates and HAVING clause.
author: Tony Lai |
TestGroupByHaving | public TestGroupByHaving(String s)(Code) | | Constructs a new SubselectTest.
|
testAggregatedGroupBy | public void testAggregatedGroupBy() throws SQLException(Code) | | Tests aggregated selection with a GROUP_BY clause. This is
a normal use of the GROUP_BY clause. The first two employees
do not have a superior, and must be grouped within the same group,
according to GROUP_BY standard.
|
testAggregatedGroupByHaving1 | public void testAggregatedGroupByHaving1() throws SQLException(Code) | | Tests aggregated selection with a GROUP_BY clause and a
HAVING clause.
This is a typical use of the GROUP_BY + HAVING clause.
The first two employees are eliminated due to the HAVING
condition.
This test uses aggregated function to eliminate first group.
|
testAggregatedGroupByHaving2 | public void testAggregatedGroupByHaving2() throws SQLException(Code) | | Tests aggregated selection with a GROUP_BY clause and a
HAVING clause.
This is a typical use of the GROUP_BY + HAVING clause.
The first two employees are eliminated due to the HAVING
condition.
This test uses GROUP_BY column to eliminate first group.
|
testHavingWithoutGroupBy1 | public void testHavingWithoutGroupBy1() throws SQLException(Code) | | Tests an unusual usage of the HAVING clause, without a
GROUP BY clause.
Only one row is returned by the aggregate selection without a
GROUP BY clause. The HAVING clause is applied to the
only returned row. In this case, the HAVING condition is
satisfied.
|
testHavingWithoutGroupBy2 | public void testHavingWithoutGroupBy2() throws SQLException(Code) | | Tests an unusual usage of the HAVING clause, without a
GROUP BY clause.
Only one row is returned by the aggregate selection without a
GROUP BY clause. The HAVING clause is applied to the
only returned row. In this case, the HAVING condition is
NOT satisfied.
|
testInvalidHaving | public void testInvalidHaving() throws SQLException(Code) | | Tests an invalid HAVING clause that contains columns not in
the GROUP BY clause. A SQLException should be thrown.
|
|
|