String comparison

When comparing two rows, how to avoid checking whether a row is from another case in MS SQL 2000

Example:

String1 = Anish String2 = anish 

When comparing Anish = anish, the result will be "rows are not equal." How do we compare these lines in this way?

+4
source share
4 answers

Here is some case sensitivity information. I see that the problem is how the server is installed.

Random search

+4
source

Change the string mapping in some form of CI (case insensitive).

eg. COLLATE Latin1_General_CI_AS

+2
source

Try the following queries separately in the Northwind database:

 SELECT * FROM dbo.Customers WHERE Country COLLATE SQL_Latin1_General_CP1_CS_AS ='Germany' SELECT * FROM dbo.Customers WHERE Country COLLATE SQL_Latin1_General_CP1_CS_AS ='geRmany' 
+1
source

String comparison in java is used to compare two different lines. We can compare a string regardless of the case (upper case / lower case). Consider str1 = "HELLO WORLD"; str2 = "hello world"; If we want to compare them with strings, there are two ways: String compareTo (String). String compareToIgnoreCase (String). String comparison: str1 compareTo (str2); This statement will return false as the result, because java is a case-sensitive language. You can also compare a string, regardless of their case, using the instruction: str1 compareToIgnoreCase (str2); This will lead to true output, because it will only check the character that is stored in str1 and str2 without worrying about the case.

0
source

All Articles