1

I expected all of the following SQL queries to return no results:

select 1 where  '-' > 'A' collate Latin1_General_BIN
select 1 where  '-' > 'A' collate SQL_Latin1_General_CP1_CI_AS
select 1 where  '-B' > 'AB' collate Latin1_General_BIN
select 1 where  '-B' > 'AB' collate SQL_Latin1_General_CP1_CI_AS

select 1 where  N'-' > N'A' collate Latin1_General_BIN
select 1 where  N'-' > N'A' collate SQL_Latin1_General_CP1_CI_AS
select 1 where  N'-B' > N'AB' collate Latin1_General_BIN
select 1 where  N'-B' > N'AB' collate SQL_Latin1_General_CP1_CI_AS

But the very last one returns 1. Something about the two characters and using nvarchar and the collation cause -B to be greater than AB, but only in this one query. Why is that?

John
  • 11
  • 1
  • It seem like this [answer](https://stackoverflow.com/a/34342009/632537) to another question may apply here. – Isaac Nov 12 '20 at 21:37

0 Answers0