Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE TABLE datetime_text(
- d1 text, -- aggiungendo COLLATE NOCASE (https://dbfiddle.uk/3YDRqT6w) utilizzerà l'indice https://sqlite.org/forum/forumpost/11ea75e73c1ed7f8
- d2 text
- );
- CREATE INDEX index_d1
- ON datetime_text(d1);
- INSERT INTO datetime_text (d1, d2) VALUES
- ('2023-01-16','a'),
- ('2023-02-12','b'),
- ('2023-06-02','c'),
- ('2023-05-05','d'),
- ('2023-10-08','e'),
- ('2023-11-03','f'),
- ('2023-12-23','g'),
- ('2023-07-21','h'),
- ('2023-03-30','i'),
- ('2023-08-28','j'),
- ('2023-09-22','k'),
- ('2023-09-25','l'),
- ('2023-08-14','m'),
- ('2023-01-31','n');
- EXPLAIN QUERY PLAN SELECT * FROM datetime_text WHERE d1 = '2023-01-16';
- EXPLAIN QUERY PLAN SELECT * FROM datetime_text WHERE d1 BETWEEN '2023-01-01' AND '2023-01-31';
- EXPLAIN QUERY PLAN SELECT * FROM datetime_text WHERE d1 LIKE '2023-01-%';
Advertisement
Comments
-
- https://dbfiddle.uk/yy4N-OMC
-
- https://sqlite.org/forum/forumpost/11ea75e73c1ed7f8 per vedere la domanda su Forum di Sqlite
Add Comment
Please, Sign In to add comment
Advertisement