I have table whose column is just the length of a session and I would like to return the number of session that have zero length and the number of sessions that have length greater than zero.
I can do that with two separate commands
select count(session_length) from my_table where session_length=0
select count(session_length) from my_table where session_length>0
You can do it with one query using conditional aggregation.
select count(case when session_length = 0 then 1 end), count(case when session_length > 0 then 1 end) from my_table