WordPress database error: [Expression #1 of ORDER BY clause is not in SELECT list, references column 'waikaka_tplg.t.name' which is not in SELECT list; this is incompatible with DISTINCT]SELECT DISTINCT t.term_id, tr.object_id
FROM tp_terms AS t INNER JOIN tp_term_taxonomy AS tt ON t.term_id = tt.term_id INNER JOIN tp_term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id
WHERE tt.taxonomy IN ('team_locations') AND tr.object_id IN (595, 597, 505, 115, 539, 444, 112, 120, 111)
ORDER BY t.name ASC