collation

is possible to have accent sensitive and case insensitive utf8 collation in mysql?

…衆ロ難τιáo~ 提交于 2019-12-29 07:43:02
问题 How can I perform accent-sensitive but case-insensitive utf8 search in mysql? Utf8_bin is case sensitive, and utf8_general_ci is accent insensitive. 回答1: There doesn't seem to be one because case sensitivity is tough to do in Unicode. There is a utf8_general_cs collation but it seems to be experimental, and according to this bug report, doesn't do what it's expected to when using LIKE. If your data consists of western umlauts only (ie. umlauts that are included in ISO-8859-1), you might be

Slow query ordering by a column in a joined table

大城市里の小女人 提交于 2019-12-29 06:47:55
问题 Introducing an ORDER BY clause in a query increases the total time due the extra work that the db have to do in order to sort the result set: copy the resulting tuples in some temporary memory sorting them (hopefully in memory, otherwise using the disk) stream the result to the client What I miss is why just adding a column from a joined table produces a so different performance. Query1 EXPLAIN ANALYZE SELECT p.* FROM product_product p JOIN django_site d ON (p.site_id = d.id) WHERE (p.active

SQL Server: set character set (not collation)

ⅰ亾dé卋堺 提交于 2019-12-29 04:00:08
问题 How does one set the default character set for fields when creating tables in SQL Server? In MySQL one does this: CREATE TABLE tableName ( name VARCHAR(128) CHARACTER SET utf8 ) DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci; Note that I set the character set twice here. It is redundant, I added both ways just to demonstrate. I set the collation also to demonstrate that collation is something different. I am not asking about setting the collation. Most questions asking about

MySQL order by string with numbers

南楼画角 提交于 2019-12-28 20:37:16
问题 I have strings such as M1 M3 M4 M14 M30 M40 etc (really any int 2-3 digits after a letter) When I do " ORDER BY name " this returns: M1, M14, M3, M30, M4, M40 When I want: M1, M3, M4, M14, M30, M40 Its treating the whole thing as a string but I want to treat it as string + int Any ideas? 回答1: You could use SUBSTR and CAST AS UNSIGNED/SIGNED within ORDER BY: SELECT * FROM table_name ORDER BY SUBSTR(col_name FROM 1 FOR 1), CAST(SUBSTR(col_name FROM 2) AS UNSIGNED) 回答2: If there can be multiple

MySQL order by string with numbers

﹥>﹥吖頭↗ 提交于 2019-12-28 20:36:32
问题 I have strings such as M1 M3 M4 M14 M30 M40 etc (really any int 2-3 digits after a letter) When I do " ORDER BY name " this returns: M1, M14, M3, M30, M4, M40 When I want: M1, M3, M4, M14, M30, M40 Its treating the whole thing as a string but I want to treat it as string + int Any ideas? 回答1: You could use SUBSTR and CAST AS UNSIGNED/SIGNED within ORDER BY: SELECT * FROM table_name ORDER BY SUBSTR(col_name FROM 1 FOR 1), CAST(SUBSTR(col_name FROM 2) AS UNSIGNED) 回答2: If there can be multiple

Microsoft.Jet.OLEDB.4.0 Converting Characters

元气小坏坏 提交于 2019-12-28 18:14:30
问题 I'm working with a CSV that contains characters like: ” and • I am reading the CSV via OleDb and the provider is Microsoft.Jet.OLEDB.4.0. when the data is loaded into the OleDbCommand, the characters are converted to the following respectively: “ and • I suspected there might be a collation setting in the connection string but I was unable to find anything about this. I can confirm the following: I can see the original character in the CSV when I open it. If I run a select on the file

How to get the sort order in Delphi as in Windows Explorer?

会有一股神秘感。 提交于 2019-12-28 03:02:06
问题 Summarization: The terminology that I have been looking for seems to be "natural sort". For behaviors in operating systems: For Windows (version >= XP), Windows Explorer utilizes natural sort. For Linux terminals: use "ls -v" instead of plain "ls" to get natural sort. For programing in Delphi, use StrCmpLogicalW Windows API to get natural sort. For programing in Delphi & Kylix & Lazarus, use hand-crafted functions to get natural sort: (1) Delphi wrapper for Natural Order String Comparison by

phpmysql error - #1273 - #1273 - Unknown collation: 'utf8mb4_general_ci'

戏子无情 提交于 2019-12-28 02:51:08
问题 I have just installed PhpMyAdmin v4.1.5 English only I have set it up to access 2 servers - the local one on my PC and the remote one on my server All is fine for my local PC but when I log in to my remote server I get the message Error MySQL said: #1273 - Unknown collation: 'utf8mb4_general_ci' Searching the PhpMyAdmin code finds one reference to this in DatabaseInterface.class.php if (PMA_MYSQL_INT_VERSION > 50503) { $default_charset = 'utf8mb4'; $default_collation = 'utf8mb4_general_ci'; }

COLLATION is not valid for CHARACTER SET not corresponding to my settings

一曲冷凌霜 提交于 2019-12-25 16:53:39
问题 I have asked another question for my problem with collation setting, which seems to be ignored/overriden by some unwanted defaults. To workaround this, I want to use COLLATE in the queries returning "illegal mix of collations" error. However, when I try to, I get "COLLATION is not valid" error instead. The query in question (I didn't face this problem with other queries yet), this time with COLLATE on the parameter ( ? translates to a string of comma-separated numbers): SELECT k.url FROM kml

Adding user defined rule to existing language

醉酒当歌 提交于 2019-12-25 08:44:53
问题 can anybody explain what the correct way is to load existing rules in a language and add some new to them. I do the following but the rule is not set. void CompareTest() { UErrorCode status = U_ZERO_ERROR; UChar ruleset[500]; *ruleset = 0; int32_t rlen = 0; UCollator *coll = ucol_open("de_DE", &status); static const UChar rules[] = L"&\\u0000 = '' = '-'"; int32_t len=(int32_t)u_strlen(rules); const UChar *defRules = ucol_getRules(coll, &rlen); if(rlen > 0) { u_strcpy(ruleset, defRules); } u