Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 want to fetch records where.....

Author  Topic 

asifbhura
Posting Yak Master

165 Posts

Posted - 2008-09-15 : 04:27:06
Hi,

I have 2 tables(tab1,tab2)

in tab1 field name id id, actiontaken etc.

in tab2 the related record for tab1
field are id, IsApprove etc

now i want records from tab1 where actiontaken=yes and its related records must be true

if related records are false then record(s) must not be fetched.
only actiontaken=yes and related records are true then only.

Regards,
ASIF

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-09-15 : 04:29:57
SELECT
FROm tab1 t1
INNER JOIN tab2 t2
ON t2.id=t1.id
where t1.actiontaken='yes'
and t2.IsApprove='true'

if ISApprove is of bit type use IsApprove=1
Go to Top of Page
   

- Advertisement -