What is CDbException Error: SQLSTATE[42000]: Syntax error or access violation while moving a site to remote?
Brad was correct in the comments above. The answer is the sql_mode. This is a duplicate of Getting this SQL Error: GROUP BY incompatible with sql_mode=only_full_group_by