-
1
- #1
Try this:
-George
Microsoft SQL Server MVP
My Blogs
SQLCop
"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
Code:
select epn.EntityID ID,
Max(BPh.AreaCode+' '+ BPh.Number) as BusPhone,
Max(BFx.areacode+' '+ BFx.Number) as BusFax
from EntityPhoneNumbers epn
left join PhoneNumbers BPh on
BPh.PhoneNumberID = epn.PhoneNumberID
and BPh.TypeID = 71
left join PhoneNumbers BFx on
BFx.PhoneNumberID = epn.PhoneNumberID
and BFx.TypeID = 74
Group By epn.EntityId
-George
Microsoft SQL Server MVP
My Blogs
SQLCop
"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom