在下面选择:
select col1, count(1)
from test_db.new_arch
where name like 'DATA1%'
or name like 'DUAL%'
group by col1
结果将是......
DATA1 10
DUAL2 11
我想合并它们,使它们看起来像这样:
DB_QUERY1 21
这可能吗?
答案 0 :(得分:1)
删除group by
以获得整个结果集的一行聚合:
select 'DB_QUERY1', count(1)
from test_db.new_arch
where name like 'DATA1%' or name like 'DUAL%';