Last active
April 10, 2021 14:05
-
-
Save flee2free/61acdb98aa0fe7e41060b8f1ebcad6e4 to your computer and use it in GitHub Desktop.
[ANKI Image File Rename] Extract the image resource, rename preserving the sort order #sql #anki
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT json_group_object( | |
trim(file_name), sequence_id | |
) AS json_result | |
FROM (select t2.sfld as file_name, t1.due, row_number() over (order by t1.due) as sequence_id | |
from cards t1 | |
inner join ( | |
select id, flds, sfld, mid | |
from notes | |
) t2 | |
on t1.nid = t2.id | |
order by t1.due); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment