Add the BINARY keyword to the end of the SET definition:
mysql> CREATE TABLE t
-> (
-> mycharcol CHAR(1),
-> mysetcol SET("a","A","b","B","c","C") BINARY
-> );
Query OK, 0 rows affected (0.00 sec)
mysql>
mysql> INSERT INTO t (mycharcol,mysetcol)
-> VALUES ("a","a"), ("b","b"), ("c","c"), ("A","A"), ("B","B"), ("C","C");
Query OK, 6 rows affected (0.03 sec)
Records: 6 Duplicates: 0 Warnings: 0
mysql>
mysql> SELECT *
-> FROM t;
+-----------+----------+
| mycharcol | mysetcol |
+-----------+----------+
| a | a |
| b | b |
| c | c |
| A | A |
| B | B |
| C | C |
+-----------+----------+
6 rows in set (0.00 sec)
mysql>
Mike Hillyer, Technical Writer
MySQL AB, www.mysql.com
Office: +1 403-380-6535
Mobile: +1 403-330-0870
Blog:
http://www.openwin.org/mike