MySQL Forums
Forum List  »  General

Re: set column type - case sensitive
Posted by: Mike Hillyer
Date: January 13, 2005 12:02PM

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

Options: ReplyQuote


Subject
Written By
Posted
Re: set column type - case sensitive
January 13, 2005 12:02PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.