Can you execute an SQL query with another "collation"?

1

I have a database in which all the tables have the collation: utf8_general_ci and I want a SELECT query to be executed with the collation: utf8_spanish_ci

Is it possible without modifying the tables? Can it be with standard SQL? How?

The purpose is to make a search engine in several languages. It's not for production.

Greetings!

    
asked by Pedro Urday 01.11.2018 в 14:01
source

1 answer

0

Because of the type of collation you put in, I understand that you're working with MySql, right? In that case you should specify the COLLATE each time you use a text field to which you want to change the collation that you have defined in the table, for example:

SELECT motivo COLLATE utf8_spanish_ci
FROM contactos
ORDER BY nombre COLLATE utf8_spanish_ci

Good luck!

    
answered by 01.11.2018 / 14:34
source