in postgresql you can sort by expression.
to sort by the file's timestamp, it is necessary to extract that from the string. based on your examples, i am going to guess that the text after the last _
will have the date. if that assumption holds, then the following will sort by date
SELECT filename from tbldata
order by reverse(split_part(reverse(filename), '_', 1))
if the number of _
is fixed, then the trick with two reverse
s is unnecessary. you can instead order by split_part(filename, '_', 3)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…