I am using the ClearDB add-on on Heroku for MySQL. For some reason, this query only works sometimes. For example if I open the web-app again after 5 minutes or so, then it works