SELECT games.*,mapping.physics 
 INTO OUTFILE '/tmp/result.txt' 
 FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
 LINES TERMINATED BY '\n'
 FROM games,mapping 
 WHERE reldate>"1970-01-01" AND reldate<"2010-01-01" AND games.category=mapping.category AND games.subcategory=mapping.subcategory;
