title: Use of Over() and Partition By returns NULL in Oracle
body: <p>I have used following query</p>
  
  <pre><code> select  distinct max( MONITORING_INT)  over(partition by  PATIENT_ADM_ID) Interval
   from PATIENT_PART
   where PATIENT_ADM_ID=1466;
  </code></pre>
  
  <p>and it returns <code>456</code>.</p>
  
  <p>The query with problematic output is as following </p>
  
  <pre><code>SELECT DISTINCT lv.NAME AS Delivery_Mode,
    pp.DELIVERY_DATETIME,
  
  
    pp.LAST_PV_EXAMINATION_DATE ,
    max( pp.MONITORING_INT)  over(partition by  pp.PATIENT_ADM_ID) Interval
  FROM PATIENT_PART pp
  LEFT JOIN LOOKUP_VALUES lv
  ON lv.id=pp.DELIVERY_MODE_ID
  WHERE pp.PATIENT_ADM_ID=1466;
  </code></pre>
  
  <p><strong>Output</strong></p>
  
  <pre><code>Delivery_Mode DELIVERY_DATETIME                  LAST_PV_EXAMINATION_DATE        Interval 
   SVD          22-APR-19 12.00.00.000000000 AM    25-APR-19 12.00.00.000000000 AM   (null)
  </code></pre>
  
  <p>but when I use the same <code>max()</code> and <code>over()</code> functionality in <code>select</code> list here in above mentioned query it returns <code>null</code>. Please let me know the reason!</p>