I always only need the most recent 10 years of data from the result set. The years will always have multiple records, so I can not pull only the first 10 records. How can I: SELECT Set 1, SELECT Set 2… through set 10 and only display those 10 years of data without pulling prior years?
Year Quarter Quarterly_yield
2012 1 8.41
2012 2 -0.71
2011 3 0.03
2011 4 3.43
2010 1 8.41
2010 2 -0.71
2009 3 0.03
2009 4 3.43
2008 1 8.41
2008 2 -0.71
2007 3 0.03
2007 4 3.43
2006 1 8.41
2006 2 -0.71
2005 3 0.03
2005 4 3.43
2004 1 8.41
2004 2 -0.71
2003 3 0.03
2003 4 3.43
2002 1 8.41
2002 2 -0.71
2001 3 0.03
2001 4 3.43
2000 1 8.41
2000 2 -0.71
You can do this this way:
This query can explained like this:
tabletablewhere year in inner query result