# GROUP BY And  HAVING
__*GROUP BY operation*__
__*HAVING clause*__
+ Filtering results after aggregation
+ For example:
  + `SELECT table_schema, count(table_name), sum(table_rows) FROM information_schema.tables GROUP BY table_schema HAVING sum(table_rows) > 300;`  
```
tidb> SELECT 
   -> table_schema, count(table_name), sum(table_rows)
   -> FROM information_schema.tables
   -> GROUP BY table_schema
   -> ~!@HAVING@!~ sum(table_rows) > 300;
+--------------+-------------------+-----------------+
| table_schema | count(table_name) | sum(table_rows) |
+--------------+-------------------+-----------------+
| test         |                 2 |         2097152 |
| demo         |                 5 |            7338 |
+--------------+-------------------+-----------------+
```

------------------------------------------------------------
[no notes]
