title: Use of Group by in (Oracle) SQL
body: <p>Relation_A(X,Y) where (X,Y) is the primary key for any tuple that belongs to Relation_A.</p>
  
  <p>I want to write a query that gets the X(s) that occur once in Relation A and also get for which Y.</p>
  
  <p>Attempt:</p>
  
  <pre><code>SELECT * 
    FROM (SELECT X, Y, COUNT(X) AS count 
            FROM Relation_A 
           GROUP BY X) WHERE count = 1;
  </code></pre>
  
  <p>This gives me an error saying that the nested query is not a GROUP BY expression.</p>