I am learning sql join and would like to clear an idea. I understand that all the select columns should present in group by clause. For example,
select a, b
from table_one
group by a,b;
I want to join two tables, something similar to this -
select table_one.a
from table_one, table_two
where table_one.id = table_two.id
group by table_two.c
The question is - should I put table_two.c in select since it is in group by clause?