title: Find unique subset
body: <p>I'm trying to query 4 columns A, B, C and D to find records where there is more than 1 D per A/B.</p>
  <p>Relationship is hierarchical from A to D; there can be multiple Ds per C, multiple Cs per B etc.</p>
  <p>e.g. here I want to find record 2 from column A because columns A and B are the same but C and D is different</p>
  <pre><code>A   B   C   D
  -------------
  1   1   1   1
  1   1   2   1
  1   1   3   1
  2   1   1   1
  2   1   2   2
  </code></pre>
  <p>I figured to group on all 4 &amp; use a <code>having</code> count d &gt; 1 but this oddly returns no results when there should be many.</p>
  <p>Is there any way to do this without using a whole bunch of sub-queries, or is that the only way?</p>
  <p>NB: data is not numerical the above is just an example. Actual data is string type.</p>