Datasets:
bench / evals /setup-graph /standards /sqlite-thread-reads-cli-image-makefile-include-build-arg /files /queries /is2_recent_messages.sql
bench / evals /setup-graph /standards /sqlite-thread-reads-cli-image-makefile-include-build-arg /files /queries /is2_recent_messages.sql
Download evals/setup-graph/standards/sqlite-thread-reads-cli-image-makefile-include-build-arg/files/queries/is2_recent_messages.sql from erdostack/bench: direct link, hf CLI and curl.
- Browser
- Download file 869 Bytes
-
https://huggingface.co/datasets/erdostack/bench/resolve/main/evals/setup-graph/standards/sqlite-thread-reads-cli-image-makefile-include-build-arg/files/queries/is2_recent_messages.sql
- Command line
-
hf download hf://datasets/erdostack/bench/evals/setup-graph/standards/sqlite-thread-reads-cli-image-makefile-include-build-arg/files/queries/is2_recent_messages.sql
-
curl -L -o is2_recent_messages.sql https://huggingface.co/datasets/erdostack/bench/resolve/main/evals/setup-graph/standards/sqlite-thread-reads-cli-image-makefile-include-build-arg/files/queries/is2_recent_messages.sql
869 Bytes
| -- The ten most recent messages written by person :p, each with the post that started its thread and that | |
| -- post's author. Newest first; ties by message id, descending. | |
| WITH RECURSIVE up(start_id, id, reply_of_id) AS ( | |
| SELECT m.id, m.id, m.reply_of_id | |
| FROM (SELECT id, reply_of_id FROM message WHERE creator_id = :p | |
| ORDER BY creation_date DESC, id DESC LIMIT 10) AS m | |
| UNION ALL | |
| SELECT up.start_id, parent.id, parent.reply_of_id | |
| FROM up JOIN message AS parent ON parent.id = up.reply_of_id | |
| ) | |
| SELECT m.id AS message_id, m.content, m.creation_date, | |
| root.id AS post_id, author.id AS post_author_id, author.first_name, author.last_name | |
| FROM up | |
| JOIN message AS m ON m.id = up.start_id | |
| JOIN message AS root ON root.id = up.id | |
| JOIN person AS author ON author.id = root.creator_id | |
| WHERE up.reply_of_id IS NULL | |
| ORDER BY m.creation_date DESC, m.id DESC; | |