Hi Guys, I am trying to make a Query that shows me a count of customers that has a office but I cant really get it to work. I have attached what I got. Hope someone can help me. All I keep getting is t1.Customerid is invalid in the select list because it is not in a group by. But I dont want to group by customerid I want a total of custom ids that either has a office or is a virtual. Does that make sense?
CASE WHEN (SELECT COUNT(*) FROM OfficeSpace WHERE CustomerId=t1.CustomerId) > 0 THEN 'Office' ELSE 'Virtual' END as CustomerType