数据湖探索 DLI-HAVING:示例

时间:2024-11-11 14:11:00

示例

对表student_info按字段name进行分组,计算每组中记录数,若其记录数等于子查询中表course_info的记录数,返回表student_info中字段name等于表course_info字段name的记录数。

1
2
3
SELECT name FROM student_info
  GROUP BY name
  HAVING count(name) = (SELECT count(*) FROM course_info);
support.huaweicloud.com/sqlref-spark-dli/dli_08_0177.html