如何 select 列表列表中出现次数最多的字符串?

How to select the maximum occurring string from a list of lists?

在我的数据库中,我有一个 table。

statement= """create table itags(
                tag_id number(10) not null primary key,
                tag_name varchar2(50) 
                )"""
cur.execute(statement)
cur.execute("INSERT INTO itags VALUES(301,'Art')")
cur.execute("INSERT INTO itags VALUES(302,'Science')")
cur.execute("INSERT INTO itags VALUES(303,'Music')")
...
so on and so forth
...

现在我想 select 并打印最广泛出现的标签名称。

如果我这样做:

cur.execute("select tag_name from itags")
res= cur.fetchall()
print(res)

我将获得一个元组列表,其中包含我存储在 table 中的标签名称。 前任: [(艺术,),(科学,),(音乐,),....]

现在我应该如何从这个元组列表中提取出现次数最多的字符串?此外,SQL 命令是否比 python 代码更有帮助?

Oracle 使用 stats_mode:

为您完成所有繁重的工作
SELECT STATS_MODE(tag_name) FROM itags