i think what you're after is this
select p.*,numberOfSocks
from
(
select top 1 pid, name
from myDB.dbo.people
order by p.pid, p.name
)p
outer apply
(
select sum(numberOfSocks) numberOfSocks
from myDb.dbo.whoHasScks ws
where p.pid = ws.pid
) ws
------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/