title: How do I join to a first row in OpenEdge SQL?
body: <p>Joining to first row in SQL should be as trivial as simply joining to an inner select</p>
  
  
  
  <pre><code>select so_nbr, sod_line last_line
    from so_mstr
    join sod_det on sod_det.rowid = (select top 1 sod_det.rowid
                                       from sod_det
                                      where sod_nbr = so_nbr
                                      order by sod_line desc) x
   where so_ord_date &gt; curdate() - 60
  </code></pre>
  
  <p>Unfortunately I get: <code>Error code -20302, SQL state HY000: [DataDirect][OpenEdge JDBC Driver][OpenEdge] TOP clause used in unsupported context. (13694)</code></p>
  
  <p>Note, I am stuck on OE10.1C and will not be able to upgrade.</p>