I have a table of 'matches' :
id match_date home_team away_team
---------------------------------------
1 2012-10-01 Milan Real
2 2013-01-05 Real PSG
3 2013-04-05 Inter Lacio
4 2013-07-10 Ajax Milan
---------------------------------------
- How can I calculate previous match of each team? As example, for home team.
- How can I calculate previous N-matches of each team?