SQL and case-insensitive conditions

I noticed in MySQL where the where clause WHERE x = 'Test'will match regardless of the case ("TEST", "test", etc.)

When using PDO, is it fair to say that this applies to most database servers? For example, if I used MSSQL or Oracle, would this be the same case?

+5
source share
4 answers

This is not the server it depends on, but sorting. Most databases are not case-sensitive by default, not case-sensitive, so you can assume that, but if you ever come across a case-sensitive situation, it's easy to change.

+8

Oracle

select * from 'test';

select * from 'test';

, , , , , Informix beiung , Sybase, , .

SQL Server, SQL Server .

, , -

+1

SQL Server . SQL Server Collation , , . .

Oracle . "UPPER" , , . .

+1

You are right, sql is generally not sensitive to strings to match strings, and this applies to almost all servers.

Here's an article showing how to do case sensitization in different ways, but if you need it!

http://vyaskn.tripod.com/case_sensitive_search_in_sql_server.htm

0
source

All Articles