title: DISTINCT results in ORA-01791: not a SELECTed expression
body: <pre><code>select DISTINCT a.FNAME||' '||a.LNAME
     from AUTHOR a, books B, BOOKAUTHOR ba, customers C, orders
     where C.firstname='BECCA'
        and C.lastname='NELSON'
        and a.AUTHORID=ba.AUTHORID
        and b.ISBN=bA.ISBN
     order by a.LNAME
  </code></pre>
  
  <p>gives   ORA-01791: not a SELECTed expression
  but works without DISTINCT.</p>
  
  <p>How to make it work?</p>