#openGauss #入门 #安装 #数据库 #开源
知识来源:docs-opengauss.osinfra.cn/zh/
示例
下面实例将找出根据c_first_name字段值进行分组,并且c_first_name字段的计数少于 2 数据:
openGauss=# SELECT c_first_name FROM customer_t1 GROUP BY c_first_name HAVING count(c_first_name) < 2;
结果如下。
c_first_name
--------------
James
Local
Joes
(4 rows)
下面实例将找出根据c_first_name字段值进行分组,并且名称的计数大于1数据:
openGauss=# SELECT c_first_name FROM customer_t1 GROUP BY c_first_name HAVING count(c_first_name) > 1;
结果如下。
c_first_name
--------------
Grace
Lily
(2 rows)
#openGauss #入门 #安装 #数据库 #开源