title: How to get the minimum date of same column in DB2
body: <p><a href="https://i.stack.imgur.com/z6LUS.png" rel="nofollow noreferrer">Need to get order qty of the minimum ADATE</a></p>
  
  <p>Im using below query and getting 12 records. Now I want to select orderqty of minimum ADATE which is 06-NOV-2018(2018-11-06).
  For every customer(will get multiple records), i need to get the Order_Qty of minimum ADATE column.</p>
  
  <pre><code>select
     Customer ,
     OrderID ,
     LocationID ,   
     Order_Qty,Sent_date ,ADATE
     from
     (
        select
        OrderID ,
        LocationID ,
        Sent_date ,
        Order_Qty ,
        Customer ,
        TimeStampA
        from ARC_TBL
     )
     obn
     inner join
     (
        select
        ADATE ,TimeStampA
        from trackTBL snt
     )snt
     on obn.TimeStampA = snt.TimeStampA
      where Customer='ABC' and OrderID='XYZ100' and Sent_date='2018-11-18' and LocationID='250';
  </code></pre>