title: Oracle SQL - repeating same column value within a group
body: <p>I'd like some help tweaking the following query</p>
  
  <pre><code>select 
      data.smalldate, 
      mip.mip_step_description, 
      error_code.error_code_en, 
      count(case when (error_code is null and quality_plan is null) then data.part_serial_number end) as "Input", 
      count(case when error_code is not null then data.part_serial_number end) as "Defects"
  from Data
  
  left join MIP
  On data.equipment = mip.equipment
  
  left join error_code
  on data.error_code = error_code.error_code_sn 
  
  group by data.smalldate, mip.mip_step_description, error_code.error_code_en
  
  order by data.smalldate, mip.mip_step_description, count(data.part_serial_number) desc
  </code></pre>
  
  <p>As you can see in the select statement, I'm using case statements within my count functions. This works fine. Data output looks like this</p>
  
  <pre><code>Date    MIP_Desc    Error_Code    Input    Defects
  1/1/2011    MIP Z    (null)       100      0
  1/1/2011    MIP Z    A            0        10
  1/1/2011    MIP Z    B            0        15
  </code></pre>
  
  <p>I'd like to fill in the same input value in the input column throughout all the rows that have the same date and MIP_Desc. </p>
  
  <p>Output should look like this</p>
  
  <pre><code>Date    MIP_Desc    Error_Code    Input    Defects
  1/1/2011    MIP Z    (null)       100      0
  1/1/2011    MIP Z    A            100      10
  1/1/2011    MIP Z    B            100      15
  </code></pre>