From d7f2a52abfefbe2a794a13b98645400143b475ee Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Mon, 30 Dec 2019 22:24:44 -0500 Subject: Order results by ID in outer query in litterbox --- litterbox.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/litterbox.c b/litterbox.c index 3ede752..af531ff 100644 --- a/litterbox.c +++ b/litterbox.c @@ -216,7 +216,8 @@ static void querySearch(struct Message *msg) { ELSE names.user END, events.target, - highlight(search, 6, :bold, :bold) + highlight(search, 6, :bold, :bold), + events.event FROM events JOIN contexts ON contexts.context = events.context JOIN names ON names.name = events.name @@ -227,7 +228,7 @@ static void querySearch(struct Message *msg) { ORDER BY events.time DESC, events.event DESC LIMIT :limit ) - SELECT * FROM results ORDER BY context, time; + SELECT * FROM results ORDER BY context, time, event; ); dbPersist(&stmt, sql); dbBindText(stmt, ":bold", "\2"); -- cgit 1.4.1