1

如何将 COLLATION 添加到以下查询....

此排序规则子句 = COLLATE Latin1_General_CS_AS

如果它完全匹配,我只需要计算 St_Text 字段。

SELECT St_Text, count(*) as Counter
FROM tblSTBackup
GROUP BY St_Text 
HAVING count(*) > 1

我试图将排序规则添加到 GROUP BY。

4

1 回答 1

2

我认为它应该是这样的:

SELECT St_Text COLLATE SQL_Latin1_General_CP1_CS_AS, count(*) as Counter
FROM tblSTBackup
GROUP BY St_Text COLLATE SQL_Latin1_General_CP1_CS_AS
HAVING count(*) > 1

SQL 小提琴演示

于 2013-05-24T20:01:09.123 回答