SQL group_by query : <p>I have a table name users. Assume in the table I have the following fields :</p>

<p>User id , UUID1 , UUID2</p>

<p>I am trying to build the following SQL query the will return :
.number of rows including both the same UUID1 and UUID2. not that UUID1 equal UUID2 but just number of row including both (GROUP BY) and in addition the number of rows contains UUID1 or UUID2 (Separately, no grouping).</p>

<p>So I would like to have a table output as followed :
UUID1 , UUID2, Number_of_Rows_Contain_both, Number_Of_Rows_Contains_Only_Only_One</p>

<p>Any idea how can I generate such a query ?</p>
