“SELECT DISTINCT” ignores different cases

后端 未结 4 1939
故里飘歌
故里飘歌 2020-12-03 06:17

I have the problem, that MSSQL Server 2000 should select some distinct values from a table (the specific column is of the nvarchar type). There are the sometimes the same va

4条回答
  •  误落风尘
    2020-12-03 07:03

    The collation will be set to case insensitive.

    You need to do something like this

    Select distinct col1 COLLATE sql_latin1_general_cp1_cs_as
    From dbo.myTable
    

提交回复
热议问题