Count

Summary

The Count aggregate function tallys the number of input rows for a given SELECT statement.

Syntax

Count(*)

Return Type

Long

Details

Connect’s xSQL dialect allows for implicit GROUP BY. It is unnecessary to explicitly use GROUP BY with Count and other aggregate functions. Connect supports the SQL HAVING clause.

Refer to the examples below.

Examples

select count(*)
from xactly.xc_participant;

screen-shot-2016-10-17-at-11-02-39-am

select first_name,
count(*)
from xactly.xc_participant;

screen-shot-2016-10-17-at-11-02-46-am

select first_name,
count(*)
from xactly.xc_participant
having count(*) > 1;

screen-shot-2016-10-17-at-11-02-56-am

Related Functions

Avg

Max

Min

Sum