I have a table that contains a security_id and side (BUY or SELL) for every trade. I want to count the number of distinct security_id and side combinations.
So when i do the following I get a list of all symbol sides but i don’t know how to get a total count?
select
security_id, side
from
trade
group by security_id, side
The result i want is 1 row which tells me how many distinct security_id, side i have in the table.
Also is there a way to determine which security_id(s) have entries for both sides (BUY and SELL).
To the second question: