SELECT t.Name INTO #table
FROM (
SELECT 'temp' AS Name
UNION all
SELECT 'TEMP' AS Name
UNION all
SELECT 'Temp' AS Name
) t
Following query result in all 3 rows:
SELECT * FROM #table
WHERE name = 'Temp'
However, following query results in only the matched row as I have used the use an case sensitive collation:
SELECT * FROM #table
WHERE name COLLATE Latin1_General_CS_AS = 'Temp'
Similarly for group by, without case sensitive collation:
SELECT COUNT(1) FROM #table WHERE
name =
'Temp'
GROUP BY name
With case sensitive collation:
SELECT count(1) FROM #table WHERE
name =
'Temp'
GROUP BY name COLLATE
Latin1_General_CS_AS
No comments:
Post a Comment