I have a field in my database which is encoded. After using from_base64 on the field it looks like this:
<string>//<string>//<string>/2017//06//21//<string>//file.txt
There may be an undetermined number of strings at the beginning of the path, however, the date (YYYY//MM//DD) will always have two fields to the right (a string followed by file extension).
I want to sort by this YYYY//MM//DD pattern and get a count for all paths with this date.
So basically I want to do this:
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>';