Luke Bowerman wrote:

With the column:
mySetCol SET ('cat','dog','mouse','giraffe','lion')

A row with the value "dog,mouse,lion" would return 3
A row with the value "cat,giraffe" would return 2

I've been able to get the MySQL server to give me a binary version of the data...

SELECT RPAD(BIN(mySetCol+0),5,'0') AS bin from projects;
+-------+
| bin   |
+-------+
| 11111 |
| 11111 |
| 11000 |
| 10000 |
| 10110 |
+-------+

If there was some way to count the occurence of the number "1" within the string I'd have my number but I don't know of anyway to that within MySQL.

I believe SELECT LENGTH(REPLACE(BIN(mySetCol+0),0,'')) FROM projects will give you what you want...

HTH!
--
Hassan Schroeder ----------------------------- [EMAIL PROTECTED]
Webtuitive Design ===  (+1) 408-938-0567   === http://webtuitive.com

                          dream.  code.



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to