Fix SQL for energy usage section