質問

How can I add COLLATION to the following query....

This Collation clause = COLLATE Latin1_General_CS_AS

I only need to count the St_Text field if it exactly matches.

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

I have tried to add the collation to the GROUP BY.

役に立ちましたか?

解決

I think this is how it should look:

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 Fiddle Demo

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top