我的产品表中有 2 列 - 名称和品牌,给定的是数据,
NAME BRAND
'Ruby Axe Guitar', 'Guitar''s & Co'
'TV' , 'LG'
当我尝试此查询时,它工作正常,
select name,brand, sum(1000) as sum,'Test' as name1
from products
group by name,brand
但即使我没有在group by
子句中包含品牌,我也感到惊讶,查询工作正常..
select name,brand, sum(1000) as sum,'Test' as name1
from products
group by name
有人可以解释吗?