I have the following select statement (MySQL table) where it shows a Y if the builder/community has a record matching the case statement.
But it is showing multiple rows for the same builder/community depending on how many Y there are for each work type schedule id.
I want to be able to show everything (all the Y or blanks) in one row for each builder community instead of multiple rows.
Thank you in advance!
¿SELECT DISTINCT Builder, Community,Charts,
CASE WHEN WorkByCommunity.workscheduletypeid=3 Or WorkByCommunity.workscheduletypeid=4 Or WorkByCommunity.workscheduletypeid=5
THEN 'Y' ELSE '' END as Flooring,
CASE WHEN WorkByCommunity.workscheduletypeid=10 THEN 'Y' ELSE '' END as ArcStone,
CASE WHEN WorkByCommunity.workscheduletypeid=11 THEN 'Y' ELSE '' END as BathAccessories,
CASE WHEN WorkByCommunity.workscheduletypeid=15 THEN 'Y' ELSE '' END as WindowTreatments,
CASE WHEN WorkByCommunity.workscheduletypeid=12 Or WorkByCommunity.workscheduletypeid=13 Or WorkByCommunity.workscheduletypeid=14 THEN 'Y' ELSE '' END as Specialties
FROM BuilderCommunity LEFT OUTER JOIN WorkByCommunity ON BuilderCommunity.BuilderCommunityID = WorkByCommunity.BuilderCommunityID WHERE BuilderCommunity.Status = 'Active'
ORDER BY Builder, Community