Articles tagged with MySQL
Replacing characters in MySQL table data.
This may be useful when for example the character encoding has been messed up and you need to correct existing data.
This example will correct swedish accent
Preferred character set and collation in MySQL
My preferred character set is utf8.
One big drawback in many cases can be that the default collation ignores accents for characters. The result is that "halla"
Selecting with a different collation in MySQL
You can select from a table and set the collation to be used for the search.
[code]
SELECT * FROM my_table WHERE my_field = 'hallÄ';
SELECT * FROM my_tab
Altering character set and collation of tables in MySQL
Altering the character set and collation of a table is sometimes not enough. You may have to alter the actual fields in the table to get MySQL to comply in some
Fixing existing data when switching character set in MySQL
When altering a database, table or field from one character set to another, existing data will probably look garbled since it is expected to be in the new chara
Inserting from a select in MySQL
Quite simple but something I can never seem to remember:
INSERT INTO files_users (file_id, user_id)
SELECT id, '2' FROM efs.files;
found @ http://mysq
Locating potential duplicate before switching collation in MySQL
When you need to switch a fields collation you can check if any existing data will conflict with this change.
For example a keyword-field might contain data
Finding ordered position of a row in MySQL
This is slightly modified from something I found @ http://www.kirupa.com/forum/archive/index.php/t-263260.html
Using high-score lists or similar you often ha
