How to select PartFamilyId and FamilyStatus is active or (active and null) based on partfamilyid concatenations by stuff ?
I work on sql server 2012 I face issue I can't get partfamilyid that have familystatus active only or active and Null
so
if partfamily have famulstatus active then it is ok i need it as 5200
if partfamily have famulstatus active and NULL then it is ok i need it as 3050
SO partfamilyid 5200 has familystatus Active so it is ok
and partfamilyid 3050 has familystatus Active and NULL so it is ok
what i need to do it :
select PartFamilyId,stuff(FamilyStatus) from #partsFamily group by PartFamilyId
Expected Result as following :