This is true in almost all of the SQL databases that I know, and I would actually have it no other way for the default. Most of the time, you don't care about case sensitivity. All the other times, you can use binary, or change the collation of the table to turn off the insensitiveness.
siccegge —
Huch almost all databases?
postgres=> select 'a' = 'A';
?column?
----------
f
(1 row)
sqlite> select 'a' = 'A';
0
That's after fixing the double-quotes that are not allowed by standard SQL
djadala —
also oracle:
SQL> select case when ('a'='A') then 1 else 0 end from dual ;
5 comments
Comments are closed. These are preserved from the original site.
mysql> SHOW VARIABLES LIKE 'collation%';
This is true in almost all of the SQL databases that I know, and I would actually have it no other way for the default. Most of the time, you don't care about case sensitivity. All the other times, you can use binary, or change the collation of the table to turn off the insensitiveness.
postgres=> select 'a' = 'A';
?column?
----------
f
(1 row)
sqlite> select 'a' = 'A';
0
That's after fixing the double-quotes that are not allowed by standard SQL
SQL> select case when ('a'='A') then 1 else 0 end from dual ;
CASEWHEN('A'='A')THEN1ELSE0END
------------------------------
0
SQL> select case when ('a'='a') then 1 else 0 end from dual ;
CASEWHEN('A'='A')THEN1ELSE0END
------------------------------
1
ha
psql=> select 'a' = 'A';
?column?
----------
f
(1 row)