strQry_3tab = Select distinct r.itdtid, t.fname From reliwdb r WITH (NOLOCK) , itdt i WITH (NOLOCK) , totalist t WITH (NOLOCK) Where r.itdtid=i.id And i.totid=t.id and r.iwdbid In (Select iwdbid From reliwdb WITH (NOLOCK) Where itdtid='0') strQry_3tab = Select distinct r.itdtid, t.fname From reliwdb r WITH (NOLOCK) , itdt i WITH (NOLOCK) , totalist t WITH (NOLOCK) Where r.itdtid=i.id And i.totid=t.id and r.iwdbid In (Select iwdbid From reliwdb WITH (NOLOCK) Where itdtid='0')