title: SQL - How to select top 3 rows for each unique value returned
body: <p>Having troubles figuring out a query here and need some input. I have a query that is joining multiple tables, and returns multiple rows for each unique value (VIN)</p>
  
  <pre><code>SELECT 
     T1.VIN
    ,T1.station                                    
    ,T1.complete_time   
    ,T2.location
    ,T1.previous_status 
  
  FROM DBName.dbo.table_name1 T1 WITH (NOLOCK)
  
  LEFT OUTER JOIN DBName.dbo.table_name2 T2  WITH (NOLOCK)
          ON T2.object_key = T1.queue_key
  
  LEFT OUTER JOIN DBName.dbo.table_name3 T3 WITH (NOLOCK)
          ON T3.op_name = T1.op_name
  
  LEFT OUTER JOIN DBName.dbo.table_name4 T4 WITH (NOLOCK)
          ON T1.VIN = T4.VIN
  
  WHERE T1.VIN IN
  (
   'ABC12301'
  ,'ABC12302'
  ,'ABC12303'
  ,'ABC12304'
  ,'ABC12305'
  ,'ABC12306'
  ,'ABC12307'
  )
  
  ORDER BY T1.complete_time desc
  </code></pre>
  
  <p>Here is what my output is. It will show all returned rows for each unique VIN</p>
  
  <pre><code>VIN      Station  Complete_Time        Location    Previous_Status
  ABC12301  SOLD    2017-02-22 09:07:00     Y            800
  ABC12301  PIT     2017-02-22 09:05:00     P            610
  ABC12301  Drag    2017-02-22 09:03:00     P            610
  ABC12301  Rain    2017-02-22 09:03:00     P            610
  ABC12301  Trim    2017-02-22 09:01:00     P            610
  ABC12302  SOLD    2017-02-22 08:59:00     Y            800
  ABC12302  PIT     2017-02-22 08:57:00     P            610
  ABC12302  Drag    2017-02-22 08:56:00     P            610
  ABC12302  Rain    2017-02-22 08:54:00     P            610
  ABC12302  Trim    2017-02-22 08:50:00     P            610
  ABC12303  SOLD    2017-02-22 08:49:00     Y            800
  ABC12303  PIT     2017-02-22 08:47:00     P            610
  ABC12303  Drag    2017-02-22 08:46:00     P            610
  ABC12303  Rain    2017-02-22 08:44:00     P            610
  ABC12303  Trim    2017-02-22 08:40:00     P            610
  .
  .
  .
  .etc.............
  </code></pre>
  
  <p>What I'd like this query to do is only show the first 3 rows for each unique VIN, like the example below</p>
  
  <pre><code>VIN      Station  Complete_Time        Location    Previous_Status
  ABC12301  SOLD    2017-02-22 09:07:00     Y            800
  ABC12301  PIT     2017-02-22 09:05:00     P            610
  ABC12301  Drag    2017-02-22 09:03:00     P            610
  
  ABC12302  SOLD    2017-02-22 08:59:00     Y            800
  ABC12302  PIT     2017-02-22 08:57:00     P            610
  ABC12302  Drag    2017-02-22 08:56:00     P            610
  
  ABC12303  SOLD    2017-02-22 08:49:00     Y            800
  ABC12303  PIT     2017-02-22 08:47:00     P            610
  ABC12303  Drag    2017-02-22 08:46:00     P            610
  </code></pre>