Subject can i aggregate data to get an unique item?
Author ndirondello marco
hi all, i have this 2 tables:

ID Bigint
Name VarChar

ID BigInt
TARGET_ID fk to table A

i need to get this result:

select count(b.Id), a.Name
from Table_A a
join Table_B b
on a.Id = b.Target_Id
group by(a.Id)

but it doesn't works becouse a.Name is not an aggregate function, what's the best way to get it?

thanks (sorry if it is a stupid question, i'm newbie to sql)