diff --git a/EntityCache/CacheUser.cs b/EntityCache/CacheUser.cs index 56c58f6..0d1f024 100644 --- a/EntityCache/CacheUser.cs +++ b/EntityCache/CacheUser.cs @@ -212,7 +212,8 @@ namespace Noikoio.RegexBot.EntityCache using (var c = db.CreateCommand()) { c.CommandText = $"SELECT {QueryColumns} FROM {SqlHelper.TableUser} WHERE " - + "( lower(username) = lower(@NameSearch) OR lower(nickname) = lower(@NameSearch) )"; + + "( lower(username) = lower(@NameSearch) OR lower(nickname) = lower(@NameSearch) ) " + + "ORDER BY cache_date desc, username"; c.Parameters.Add("@NameSearch", NpgsqlTypes.NpgsqlDbType.Text).Value = name; if (disc != null) {