title: left join lateral
body: <p>Very simple question. Trying to use a LEFT JOIN LATERAL function in Oracle SQL Developer version 4.1.5.</p>
  
  <p>Can you guys confirm if this exists (I assume so since it gives no indication that the function isn't available) and if so, what is the syntax required?</p>
  
  <p>I have tried a host of different options (limit 1, offset 0 rows fetch next 1 row only, fetch 1 row only...but to no avail)</p>
  
  <p>Can you please review the code below to see if anything stands out what I am missing? I simply want to create date bands on this data output.</p>
  
  <pre><code>SELECT    a.pol_sys_id, 
            a.pol_end_dt, 
            b.pol_end_dt AS pol_end_dt2 
  FROM      staging.stgt_policy a 
  LEFT JOIN lateral 
            ( 
                     select   * 
                     from     staging.stgt_policy b1 
                     WHERE    a.pol_sys_id = b1.pol_sys_id 
                     AND      b1.pol_end_dt &gt; a.pol_end_dt 
                     ORDER BY b1.pol_end_dt
                     FETCH first 1 rows only 
                           --tried limit 1 
                           --tried offset 0 rows fetch next 1 row only 
            ) b 
  ON        a.pol_sys_id = b.pol_sys_id 
  ORDER BY  a.pol_sys_id. a.pol_end_dt;
  </code></pre>
  
  <p>Thanks for any advice you can offer.</p>