Reputation: 161
I have the following table:
For each member from this table, I would like to get the event date. The event date should be pulled by comparing the event dates for "run" and 'jog" events and which ever date is smaller/earlier, that date is what i need.
So my output table will look like:
Upvotes: 0
Views: 68
Reputation: 44951
Assuming event_date is of date type or at least a string in YYYY-MM-DD format (and it was changed in the Excel)
select member
,min(event_date)
from mytable
where event in ('run','jog')
group by member
Upvotes: 1