I hope I'm not doing your homework for you...
There are 2 things that make this a little tricky, first you have to construct an interim query that sums the advances and join to the main table. The second tricky thing is that you have to make sure all names are represented in the interim query so they will not be excluded by the join. This means accounting for NULLS and replacing with a ZERO advance value.
drop table #tempadvance
CREATE TABLE #tempSaldetail(
[ID] [int] NOT NULL,
[ENAME] [varchar](32) NOT NULL,
[SAL] [INT] NOT NULL
)
CREATE TABLE #tempAdvance(
[ID] [int] NOT NULL,
[ADVANCE] [int] NOT NULL
)
GO
insert into #tempSaldetail select 1, 'ANU', 10000
insert into #tempSaldetail select 2, 'APARNA', 20000
insert into #tempSaldetail select 3, 'ANANYA', 15000
insert into #tempSaldetail select 4, 'ANUPAMA', 40000
insert into #tempSaldetail select 5, 'AMRUTHA', 20000
INSERT INTO #tempAdvance SELECT 1, 1000
INSERT INTO #tempAdvance SELECT 2, 500
INSERT INTO #tempAdvance SELECT 5, 200
INSERT INTO #tempAdvance SELECT 1, 2000
INSERT INTO #tempAdvance SELECT 2, 200
SELECT s.ID, ENAME, s.Sal - (adv.totalAdvance) from #tempSaldetail s
join (select sal.id, ISNULL(sum(advance),0) as totaladvance from #tempSaldetail sal
left outer join #tempAdvance A on
sal.id = a.id group by sal.id) as adv
on adv.id = s.id