The error message is rather confusing as it indicates operation = - this is not obvious from the request you sent, but is called by a UNION request that selects only individual values. Thus, using implicit equality matching.
In either case, you can always force the column to be sorted using the COLLATE . Here is an example if you want to change the sorting of the tipo column:
SELECT id, titulo, 'foto' COLLATE utf8_general_ci AS tipo ... UNION SELECT id, titulo, 'video' COLLATE utf8_general_ci AS tipo, ...
source share