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)
 How can i exclude all the row if any 1 row meet t

Author  Topic 

neo_6053
Starting Member

24 Posts

Posted - 2008-04-30 : 07:00:41


how can i exclude all the row if any 1 row meet the condition.
as my example show, i want to exclude all the "SINDA" row if my RsdFund = 'FWL'. that means whenever there is a SINDA fund with FWL RsdFund, i want to abandon all the SINDA row.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-04-30 : 07:54:08
Can you show some sample data of your table?
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-04-30 : 08:12:58
SELECT kz.*
FROM kz_vRelignFundMap AS kz
WHERE NOT EXISTS (SELECT * FROM kz_vRelignFundMap AS fm WHERE fm.FundID = kz.FundID AND fm.RsdFund = 'FWL')



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2008-04-30 : 13:54:14
Do you want to exclude all the "SINDA" rows if a row exists that has FundID = 'SINDA' and RsdFund = 'FWL'? If so, this might work:
SELECT 
*
FROM
kz_vRelignFundMap
WHERE
FundID = 'SINDA'
AND EXISTS (SELECT * FROM kz_vRelignFundMap WHERE FundID = 'SINDA' AND RsdFund = 'FWL')
Go to Top of Page
   

- Advertisement -