HOW TO AVOID THE GROUP BY FOR ALL COLUMNS IN SELECTSTATEMENT
SELECT a.Name,
a.id,
a.Type,
a.date,
COUNT(b.pac),
a.ConName
FROM TableA a
JOIN TableB b ON a.Taskgenid = b.Taskgenid
AND a.formgenid = b.formgenid
JOIN TableC c ON A.id = c.ID
JOIN TableD d ON D.Typeid = c.Typeid
WHERE a.date BETWEEN @Begindate AND @Enddate
AND a.type IN (1, 2, 3)
GROUP BY a.Name,
a.id,
a.Type,
a.date,
a.ConName
I doesnt want to group the columns a.id,a.type,a.date,a.conname. If i remove those columns it showing error that a.id, a.type,a.date,a.conname is not group by or aggregate.
I want only Count(b.pac)