Ruby代码
mysql>selectsum(if(locate(',watch,',concat(",",seokeyword,","))>0,1,0))aswatch,sum(if(locate(',fashionwatch,',concat(',',seokeyword,',')>0,1,0))as`fashionwatch`
fromuxcell_channels;
+-------+---------------+
|watch|fashionwatch|
+-------+---------------+
|928|501|
+-------+---------------+
mysql>selectsum(if(locate(',watch,',concat(",",seokeyword,","))>0,1,0))aswatch,sum(if(locate(',fashionwatch,',concat(',',seokeyword,',')>0,1,0))as`fashionwatch`
fromuxcell_channels;
+-------+---------------+
|watch|fashionwatch|
+-------+---------------+
|928|501|
+-------+---------------+
Ruby代码
ux.first.attributes
ux.first.attributes.keys
mysql>selectsum(if(locate(',watch,',concat(",",seokeyword,","))>0,1,0))aswatch,sum(if(locate(',fashionwatch,',concat(',',seokeyword,',')>0,1,0))as`fashionwatch`
fromuxcell_channels;
+-------+---------------+
|watch|fashionwatch|
+-------+---------------+
|928|501|
+-------+---------------+
mysql>selectsum(if(locate(',watch,',concat(",",seokeyword,","))>0,1,0))aswatch,sum(if(locate(',fashionwatch,',concat(',',seokeyword,',')>0,1,0))as`fashionwatch`
fromuxcell_channels;
+-------+---------------+
|watch|fashionwatch|
+-------+---------------+
|928|501|
+-------+---------------+
Ruby代码
ux.first.attributes
ux.first.attributes.keys