Completion Counting only Once Have an SQL query for DB2 that returns the timestamp of when an event completed. It completes at 2 different date/times, which is the result expected.

That result completes at those 2 different times for the same entity. I desire that the entity be counted one time for the purposes of my query.

How would I get the query to return the result for only the first instance of completion for that entity?
You don't specify what "first" means (or provide any table structure or example data), but let's assume it's the earliest completion timestamp:

  SELECT entity, min(completion_ts)
    FROM your_table
GROUP BY entity


If you are just getting results for a single entity, you can simplify even more:

  SELECT min(completion_ts)
    FROM your_table
   WHERE entity = 'XXX'