我的数据库中有一个已编码的字段。在字段上使用 from_base64 后,它看起来像这样:
<string>//<string>//<string>/2017//06//21//<string>//file.txt
路径开头可能有不确定数量的字符串,但是,日期 (YYYY//MM//DD) 将始终在右侧有两个字段(一个字符串后跟文件扩展名)。
我想按这个 YYYY//MM//DD 模式排序,并计算这个日期的所有路径。
所以基本上我想这样做:
select '<YYYY//MM//DD portion of decoded_path>', count(*) from table group by '<YYYY//MM//DD portion of decoded_path>' order by '<YYYY//MM//DD portion of decoded_path>';