Sql Query - What is the query for this?

Joined
Jan 10, 2007
Messages
43,898
Location
In The Machine
We're using Sql Server 2K5.

I have a table containing dates for an events table.* The dates table contains one or more dates for a single event.* What is the query on the dates table that returns only 1 date (the earliest date) for each event.

So the the dates table looks like this:
id* event_id* date
1** 37********** 2007/02/01
2** 37********** 2007/01/01
3** 38********** 2006/01/01
4** 39********** 2007/04/01
5** 39********** 2006/01/01

I looking for a dates table resultset of:
id* event_id* date
1** 37********** 2007/01/01
3** 38********** 2006/01/01
5** 39********** 2006/01/01

Notice there is only* one entry for each event_id and this date represents the earliest time for the event.

Thanks for the query.


More...

View All Our Microsoft Related Feeds
 
Back
Top