collation

How do I perform an accent insensitive compare (e with è, é, ê and ë) in SQL Server?

放肆的年华 提交于 2019-12-17 02:10:50
问题 I'm looking to compare two varchars in SQL, one would be something like Cafe and the other Café is there a way in SQL that will allow the two values to be compared. For instance: SELECT * FROM Venue WHERE Name Like '%cafe%' So if there is a venue with the name Big Bobs Café Extraordinaire it would be included in the result set? 回答1: Coerce to an accent insensitive collation You'll also need to ensure both side have the same collation to avoid errors or further coercions if you want to compare

What is the best collation to use for MySQL with PHP? [closed]

放肆的年华 提交于 2019-12-17 01:24:06
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 4 years ago . I'm wondering if there is a "best" choice for collation in MySQL for a general website where you aren't 100% sure of what will be entered? I understand that all the encodings should be the same, such as MySQL, Apache, the HTML and anything inside PHP. In the past I have set

i get an error when creating a variable and specifing the collation in sql server 2005

心不动则不痛 提交于 2019-12-16 18:04:31
问题 when i tried this: DECLARE @var nvarchar(500) collate Arabic_BIN i got that: Msg 156, Level 15, State 1, Line 1 Incorrect syntax near the keyword 'collate'. that is the full code, it works, i do not know how but the person who give it to me have used it successfully CREATE FUNCTION fn_RemoveTashkeel (@InputString nvarchar(2300) ) RETURNS nvarchar(2300) AS BEGIN DECLARE @OutputString nvarchar(2300) COLLATE Arabic_BIN DECLARE @TashkeelChr char(8) COLLATE Arabic_BIN DECLARE @feed int SET

i get an error when creating a variable and specifing the collation in sql server 2005

强颜欢笑 提交于 2019-12-16 18:04:22
问题 when i tried this: DECLARE @var nvarchar(500) collate Arabic_BIN i got that: Msg 156, Level 15, State 1, Line 1 Incorrect syntax near the keyword 'collate'. that is the full code, it works, i do not know how but the person who give it to me have used it successfully CREATE FUNCTION fn_RemoveTashkeel (@InputString nvarchar(2300) ) RETURNS nvarchar(2300) AS BEGIN DECLARE @OutputString nvarchar(2300) COLLATE Arabic_BIN DECLARE @TashkeelChr char(8) COLLATE Arabic_BIN DECLARE @feed int SET

Set Order By to ignore punctuation on a per-column basis

梦想与她 提交于 2019-12-14 04:16:40
问题 Is it possible to order the results of a PostgreSQL query by a title field that contains characters like [](),; etc but do so ignoring these punctuation characters and sorting only by the text characters? I've read articles on changing the database collation or locale but have not found any clear instructions on how to do this on an existing database an on a per-column basis. Is this even possible? 回答1: If you want to have this ordering in one particular query you can ORDER BY regexp_replace

Problem with Persian_CI_AI collation And 'ك' character

淺唱寂寞╮ 提交于 2019-12-14 02:09:24
问题 I installed sql server 2008 enterprise and created a sample database whit Persian_CI_AI Collation. then from a visual studio 2010 windows application i insert the word "اسكندر" whith two type of 'ك'(arabic & Persian) but in the search time result show me just one 'اسكندر' . Please Help me 回答1: you can this procedure in vb.net for your problem ''' <summary> ''' این روال در برطرف کردن مشکل جستجوی حروف عربی کاربرد دارد ''' مقدار خروجی حرف ی فارسی را با یاء عربی جایگزین میکند ''' </summary> '''

MySQL collation and PHP charset conflict

我与影子孤独终老i 提交于 2019-12-13 21:17:25
问题 I have a bunch of Danish text taken from a latin-1 MySQL database and it displays correctly when echoed in PHP. The problem starts when I need to echo some other Danish characters, which are not taken from the database. What I do is actually output the header Content-Type: text/html; charset=iso-8859-1 to also let the non-queried characters to display correctly as well. Problems is, when I do that the queried characters display incorrectly. 回答1: Just because the data is stored in a latin-1

Storing German special characters into MySQL database [duplicate]

被刻印的时光 ゝ 提交于 2019-12-13 08:37:58
问题 This question already has answers here : UTF-8 all the way through (15 answers) Closed 5 years ago . I'm having an issue with storing the German characters into MySQL database. Database Collation = utf8_bin Also I'm firing a query to database before my original query that is mysqli_query($connection, "SET NAMES 'utf8'"); Here is my Final Query=> INSERT INTO professionals(name,address,phone,description,homepage) VALUES('Dr. med. Monika Makvandi-Nezhad','Zweibrückenstr. 680331 München','089

“Illegal mix of collations for operation 'concat'” appears after data base import

浪尽此生 提交于 2019-12-13 07:37:44
问题 In my old site, this problem does not exist. But after I have changed the server and imported the data base, this message appears. The PHP version is 5.3 and this is the code: $sql = "SELECT * FROM movcaixa WHERE data BETWEEN '$data1' AND '$data2' AND empresa = $empresa ORDER BY data ASC"; $resMovCaixa = mysql_query($sql, $cnn) or die('Falha na conexão com o banco de dados'); $sql = "SELECT cp.id AS codigo, CONCAT('Pagamento ref. a ', des.descricao, ', conforme doc. nº ', cp.documento) AS

Which MySQL collation exactly matches PHP's string comparison?

烂漫一生 提交于 2019-12-13 06:54:07
问题 Here is a MySQL query: SELECT last_name FROM users ORDER BY last_name We get all that data into PHP and then run: $prior = NULL; do { $current = array_shift($results); assert($current >= $prior); $prior = $current; } while ($current !== NULL); Currently this assertion fails for certain inputs. Is it possible to add a COLLATE clause to the MySQL query above to absolutely guarantee that PHP assertion? Stuff I tried: The above code, it doesn't work for certain non-ASCII inputs ORDER BY email