[ask] count items in the SET(value1,value2,value3)

2012-09-24 Thread Morning Star
Hi guys, i created a table, one of column named categories contain SET as its data type. let's say there are N-value in that column. i inserted a row to that column which contain only 5 values. INSERT INTO table SET categories ='value1, value2, value3, value4, value5' ; the question is: how can i c

Re: [ask] count items in the SET(value1,value2,value3)

2012-09-25 Thread Morning Star
On Tue, Sep 25, 2012 at 12:31 AM, Rick James wrote: > SET foo (...) > Maybe: > SELECT BIT_COUNT(foo) ... > It works. Thanks! :) Greetings, Marco -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql

passing shell variable to the SET data type in parentheses

2012-10-03 Thread Morning Star
Hi guys, i have a problem when trying to pass shell variable to the SET data type in parentheses. i have a variable like this: $ echo $var "value1","value2","value3" what i did: mysql -u $user -p${password} --skip-column-names -e 'ALTER TABLE '$table' MODIFY '$kolom' SET(" '$var' ");' $database ;

Re: passing shell variable to the SET data type in parentheses

2012-10-03 Thread Morning Star
Thanks guys for all the corrections. I fix it by executing: mysql -u $user -p${password} --skip-column-names -e 'ALTER TABLE '$table' MODIFY '$kolom' SET( '$var' );' $database ; :) Greetings, Marco On Thu, Oct 4, 2012 at 4:49 AM, wrote: &g