I have a report looking at courses for my college. Each course can have multiple attributes (which I return with a sub query for each stating 'Y' or 'N' if they are associated with said attribute). My end user is requesting an additional column which states if they are associated with multiple attributes - so the column will return 'Y' if they have multiple attributes, or a 'N' if they only have one attribute. I am requesting assistance in coding the 'Multiple' column, as I am returning a Y or N for each attribute by using sub queries, and not quite sure how to compare the sub queries together to return a value if they have multiple attributes (meaning more than one of the sub queries will return a 'Y').
Return a value when multiple subqueries are true
in SQL
Posted
Hello,
I have a report looking at courses for my college. Each course can have multiple attributes (which I return with a sub query for each stating 'Y' or 'N' if they are associated with said attribute). My end user is requesting an additional column which states if they are associated with multiple attributes - so the column will return 'Y' if they have multiple attributes, or a 'N' if they only have one attribute. I am requesting assistance in coding the 'Multiple' column, as I am returning a Y or N for each attribute by using sub queries, and not quite sure how to compare the sub queries together to return a value if they have multiple attributes (meaning more than one of the sub queries will return a 'Y').
Thank you.