...
adapting query for MYSQL