I need an output that will display the TripName, [Type], FirstName, LastName and [NumberOfGuides] from this query, but I get an error stating:
"Msg 512, Level 16, State 1, Line 2 Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <=,
, >= or when the subquery is used as an expression."
select TripName, [Type], FirstName, LastName, (select count(*)
from Guide g, TripGuide tr, Trip t
where g.GuideNum = tr.GuideNum and t.TripID = tr.TripID
group by TripName, Type
having count(*) > 1 ) as [NumberOfGuides]
from Guide, Trip
order by NumberOfGuides desc