Fixed sample query to work with mysql 5.5 or later