我正在学习 sql join 并想明确一个想法。我知道所有选择列都应该出现在 group by 子句中。例如,
select a, b
from table_one
group by a,b;
我想加入两个表,类似于这个 -
select table_one.a
from table_one, table_two
where table_one.id = table_two.id
group by table_two.c
问题是 - 我应该把 table_two.c 放在 select 中,因为它在 group by 子句中吗?