开发者

SQL help, selecting specific columns

I have a nvarchar column which also has non-English (a-z) characters like Crystal77, Bólido Comidas.

How can I specifically select the rows which con开发者_StackOverflow中文版tain non-English characters in that column?

Thanks


All rows where any character not in the range a-z

I've used COLLATE with a binary collation to remove the false match against ó... it appears LIKE is ignoring accents but that could be because it's unicode

DECLARE @myTable TABLE (myColumn nvarchar(100))
INSERT @myTable (myColumn) VALUES ('Crystal77'), ('Bólido Comidas'), ('PlainEnglish')

SELECT * FROM @myTable
     WHERE myColumn COLLATE Latin1_General_BIN NOT LIKE '%[^ a-zA-Z]%'
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜