In the T_employee table, when you practice using the CONCAT function to concatenate strings,
Mysql> Select Concat (' Work number: ', Fnumber, ' Employee's Happiness Index: ', fsalary/(fage-21))
From T_employee;
1271-illegal mix of collations for operation ' Concat ' ERROR
On the web to see the related error article found that there is a problem with the character set of the field, my Fnumber field here is Latin1, and the field Operation defaults to UTF8 encoding. Absolute uniform use of UTF-8.
After you modify the character set to Utf-8, run the SQL command again
Mysql> Select Concat (' Work number: ', Fnumber, ' Employee's Happiness Index: ', fsalary/(fage-21))
From T_employee;
+-----------------------------------------------------------------+
| Concat (' Work number: ', Fnumber, ' Employee's Happiness Index: ', fsalary/(fage-21)) |
+-----------------------------------------------------------------+
| Work Number: DEV001 's employee's happiness index: 2075.000000 |
| Work Number: DEV002 's employee's happiness index: 328.685714 |
| Work Number: HR001 's employee's happiness index: 1100.400000 |
| Work Number: HR002 's employee's happiness index: 1300.090000 |
| Work Number: IT001 's employee's happiness index: 557.142857 |
| Work Number: IT002 's employee's happiness index: 466.666667 |
| Work Number: SALES001 's employee's happiness index: 2500.000000 |
| Work Number: SALES002 's employee's happiness index: 885.714286 |
| Work Number: Sales003 's employee's happiness index: 1200.000000 |
+-----------------------------------------------------------------+
9 Rows in Set
The search data is correct, no error.
Illegal mix of collations for operation ' Concat '