1
的具体数量对于这样一个表格中选取项目:包含给定字符(SQL)
visits url
594 http://example.com/page1/stuff
302 http://example.com/page2
494 http://example.com
202 http://example.com/page3/stuff/more
我想选择只包含4个/
字符的URL。
在python中,我会使用len(url.split('/')) == 5
。这怎么能在SQL查询中完成?
它们可以是连续的,以及在它们之间没有字符的另一序列?例如:'http://example.com ///' –
当然 - 所以在你的例子中,我们会计数5 – AlexG
'length(url)-len(replace(url,'/',''))= 4'? –