http://www.brainbell.com/tutorials/MySQL/Working_With_Cursors.htm
http://dev.mysql.com/doc/refman/5.0/en/cursors.html
Caution:
DECLARE Statement Sequence: There is specific order in which DECLARE statements, if used, must be issued. Local variables defined with DECLARE must be defined before any cursors or handlers are defined, and handlers must be defined after any cursors. Failure to follow this sequencing will generate an error message.
Sub-Select
http://articles.techrepublic.com.com/5100-10878_11-1045787.html
Joining
http://en.wikipedia.org/wiki/Join_(SQL)
Derived Tables
http://dev.mysql.com/doc/refman/5.0/en/unnamed-views.html
http://www.mysqlperformanceblog.com/2006/08/31/derived-tables-and-views-performance/
http://www.experts-exchange.com/Database/MySQL/Q_23042622.html