title: Oracle LAG/LEAD analytic functions works as join or not?
body: <p><strong>lag</strong>/<strong>lead</strong> analytic functions allow access to previous/next rows without join technique according official docs:</p>
  
  <ul>
  <li><a href="http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions070.htm" rel="nofollow">http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions070.htm</a></li>
  <li><a href="http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions074.htm" rel="nofollow">http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions074.htm</a></li>
  </ul>
  
  <p>Does that mean that if I include fields which are not <em>lag/lead</em> - Oracle do join on this fields?</p>
  
  <p>So if I query currency rates (to find holes - the day where are no rate defined):</p>
  
  <pre><code> select CURRENCY, RATE, XDATE, lead(XDATE) over (order by XDATE) from CURRENCY_RATE
  </code></pre>
  
  <p>I get <em>lead(XDATE)</em> for same <em>CURRENCY</em> as <em>XDATE</em>?</p>
  
  <p>Or <strong>partition by</strong> keyword in <strong>lead</strong> expression must be used on  <em>CURRENCY</em> to achieve this goal?</p>