There is problem while checking case sensetive string in SQL select statement.
We can use a keyword "BINARY" in such case.
Syntax :
select *
from
tableName
where
fieldName = BINARY 'value'
OR
select fieldList
from
tableName
where
fieldName = BINARY 'value'
Where
fieldList : Comma saperated List of fields to select.
tableName : Name of table to select fields form.
fieldName : Field name of which we are checking string.
value : Value to cros check.
Eg :-
If we have a table as
Table Name : EmployeeMaster
Field List :
EmployeeName : varchar (50)
EmployeeCode : varchar (10)
Now we want to select Employees having name exactly 'JON' and case sensetive.
Then SQL select statement will be
select
EmployeeCode,EmployeeName
from
EmployeeMaster
where
EmployeeName = BINARY 'JON'
Note : I have checked this statement in MySql.There might be other way in other RDBMS.
Read More!