cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Count Number of Groupings

awassel
Newcomer

I'm using the below query but it's not giving me the exact 

SELECT userSessionId, COUNT(*) FILTER > 1 FROM usersession GROUP BY userSessionId

 This give me the table with all the results, but I'm looking for the total number of groupings. Basically, this is the result:

userSessionIdcount(*)
XXXXXXXX3
XXXXX3
XXXXXXXXX-XX2
XXXXX2
XXXXXXXXXXXXXXX2

 

However, I'm looking to get 5 - or the total number of rows (groups) in the table.

Is this possible?

2 REPLIES 2

p_devulapalli
Champion

Hi @awassel ,   Does something like below work ? If not, could you please elaborate your query a bit further 

SELECT COUNT(DISTINCT userSessionId) AS sessionCount
FROM usersession

 

Phani Devulapalli

Peter_Youssef
Leader

Hi @awassel 

As per the attached query the below result will be presented 

Peter_Youssef_0-1728281088195.png

And as per the query provided by @p_devulapalli, the below result is presented.

Peter_Youssef_1-1728281153444.png

BR,

Featured Posts