November 18, 2015 at 9:24 pm
I have table with content as below:
IDName Description
1Name_A des_kakà
2Name_B des_kaka
3Name_C des_kaká
4Name_D des_amazon
I want search description with keyword: 'kaka' and I want result
IDName Description
1Name_A des_kakà
2Name_B des_kaka
3Name_C des_kaká
Please help to resolve above issue.
Thank you very much
November 18, 2015 at 11:03 pm
November 19, 2015 at 6:23 am
Can you just use like function?
Select * from table
where description like 'des_kak%'
November 19, 2015 at 6:45 am
Then you're searching for a specific pattern.. what if the accent if on other characters?
By matching accents in the collation hint, the data will be compared correctly and accurately and will cater for all variations.
November 19, 2015 at 7:02 am
Lip turner (11/19/2015)
Can you just use like function?Select * from table
where description like 'des_kak%'
Always test:
DROP TABLE #SampleData
SELECT *
INTO #SampleData
FROM (VALUES
(1, 'Name_A', CAST('des_kakà' AS NVARCHAR(20))),
(2, 'Name_B', CAST('des_kaka' AS NVARCHAR(20))),
(3, 'Name_C', CAST('des_kaká' AS NVARCHAR(20))),
(4, 'Name_D', CAST('des_amazon' AS NVARCHAR(20)))
) d (ID, Name, [Description])
DECLARE @Keyword NVARCHAR(20) = '%kaka%'
SELECT *
FROM #SampleData
WHERE [Description] COLLATE Latin1_general_CI_AI LIKE @Keyword COLLATE Latin1_general_CI_AI
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
November 19, 2015 at 7:13 am
Thank you very much,
I did successful
November 19, 2015 at 11:09 am
ChrisM@Work (11/19/2015)
Always test:
+1000
--Jeff Moden
Change is inevitable... Change for the better is not.
November 19, 2015 at 3:50 pm
Sorry guys, I totally forget about that. Now I understand better. Thank you, all 🙂
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply