From 59f5a822610649a01b0a35760bb756658b46ffc0 Mon Sep 17 00:00:00 2001 From: zhangyuhang <2827528315@qq.com> Date: Thu, 13 Mar 2025 16:06:42 +0800 Subject: [PATCH] fix: Resolve errors in SQL queries caused by SELECT fields not appearing in the GROUP BY clause. (#15659) Co-authored-by: yuhang2.zhang --- api/services/tag_service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/services/tag_service.py b/api/services/tag_service.py index 9600601633..1fbaee96e8 100644 --- a/api/services/tag_service.py +++ b/api/services/tag_service.py @@ -20,7 +20,7 @@ class TagService: ) if keyword: query = query.filter(db.and_(Tag.name.ilike(f"%{keyword}%"))) - query = query.group_by(Tag.id) + query = query.group_by(Tag.id, Tag.type, Tag.name, Tag.created_at) results: list = query.order_by(Tag.created_at.desc()).all() return results