Anki/rslib/src/search/template_order.sql
2021-01-09 14:08:55 +10:00

12 lines
No EOL
250 B
SQL

DROP TABLE IF EXISTS sort_order;
CREATE TEMPORARY TABLE sort_order (
pos integer PRIMARY KEY,
ntid integer NOT NULL,
ord integer NOT NULL,
UNIQUE(ntid, ord)
);
INSERT INTO sort_order (ntid, ord)
SELECT ntid,
ord
FROM templates
ORDER BY name