title: Would you use distinct, or maybe a window function to do this?
body: <p>Is there someway to shortcut it? window function? Group by? Or is distinct the right approach?</p>
  <pre><code>select
       distinct itemid item_id
      from
          unitactuals.unitserials
      where
          mfgdate &gt; $begin_date_range
          and mfgdate &lt; $end_date_range
          and siteid = $site_id
          and serial like ($serial_prefix || '%')
  </code></pre>