title: SELECT DISTINCT on multiple columns along with other columns
body: <p>I want to run query like below</p>
  
  <pre><code>select distinct (columnA, columnB, columnC), columnD from MY_TABLE where columnA IS NOT NULL AND columnB IS NOT NULL AND columnC is NOT NULL;
  </code></pre>
  
  <p>I only want distinct of columnA, columnB and columnC and NOT ON columnD.
  But SQL developer is pointing an error right after columnA, 
  How can I fix this?</p>
  
  <p>I tried to fix my query using GROUP BY</p>
  
  <pre><code>select columnA, columnB, columnC, (select count(*) from TABLE2 WHERE table2columnA = myTable.columnA) from MY_TABLE myTable where columnA IS NOT NULL AND columnB IS NOT NULL AND columnC is NOT NULL GROUP BY columnA, columnB, columnC;
  </code></pre>
  
  <p>Notice that my columnD is actually another select statement?
  But this is giving me error </p>
  
  <pre><code>ORA-00979: not a GROUP BY expression
  00979. 00000 -  "not a GROUP BY expression"
  </code></pre>
  
  <p>This is not a duplicate of that another question</p>