select
c.Id, c.FirstName, dbo.GetClientStaffContacts(c.Id, '27,31') as Staff
from
Client c
where
dbo.GetClientStaffContacts(c.Id, '27,31') is not null
order
by c.Id
select
c.Id, c.FirstName, dbo.GetClientStaffContacts(c.Id, '27,31') as Staff
from
Client c
where
dbo.GetClientStaffContacts(c.Id, '27,31') is not null
order
by c.Id