fixed SQL on stock_stats.sql