I've never really worked with dates in MySQL before, so this is new territory for me, but I've been reading into DATEDIFF to try to achieve the following:
I have two tables. One with a list of players and one with a list of goals scored. What I want to display is ONE result for the player who was the YOUNGEST scorer of a goal.
Within the tables, I have:
PlayerID | PlayerName | PlayerDOB
GoalID | GoalPlayerID | GoalMatchDate
So, I'm assuming we're looking at the DATEDIFF between the MIN(GoalMatchDate) and the PlayerDOB, while PlayerID = GoalPlayerID. That being said, I'm completely at a loss on how to start to query this, most specifically, in terms of limiting it to one query and how to order it by the difference in the dates.
Hopefully someone can put me on the right track or even be so kind as to post an example that I could follow.
I am using MySQL 5.0.