Basicly I have a bunch of Cars that belong to dealers and the dealers have a group.
The dealer table has the GROUP.ID and the Group table has the group name.
A Group has multiple dealers
So I want to count how many cars each group has.
I am using this atm
select
(select GROUP_NAME from "GROUP" where "GROUP".GROUP_ID = "DEALER"."GROUP_ID" ),
"DEALER"."GROUP_ID" as "DEALER GROUP ID",
"DEALER"."DEALER_NAME" as "DEALER DEALER NAME",
"CAR"."CAR_DEALER" as "CAR DEALER"
from
"CAR"
INNER JOIN
DEALER
ON
"DEALER"."DEALER_NAME" ="CAR"."CAR_DEALER"
I tried using group_by
and count
but I can't seem to get it to work
Best Answer