【发布时间】:2015-02-08 20:26:45
【问题描述】:
我有带有值的 mysql 表文本(id,文本):
1, 'some #text with #hashtags ...'
2, 'more #text without....'
... and more
可以在 sql 中获取任何主题标签的计数吗? 某事
like select count(regexp) from text where...regexp... magic happened ;)
需要的结果:#text ...2x, $#hashtags 1x
我无法用
选择文本select * from table where text REGEXP '#[a-z]*
但是这样我只得到带有任何#hashtag的行
有什么想法吗?
好吧,我当然可以全选并用php计算结果,但它可能只有mysql解决方案?
【问题讨论】: