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.
Author |
Topic |
acantilado
Starting Member
1 Post |
Posted - 2007-12-27 : 02:30:47
|
SELECT A.ID, A.Status, B.Identified, B.PrimaryOwner,C.PassP, C.PassC, C.primaryidentityFROM Test1Vw A with (NOLOCK)INNER JOIN Test2Vw B with (NOLOCK) ON B.CID = A.ID INNER JOIN Test3Vw C with (NOLOCK) ON A.CPID = C.ID WHERE (A.STATUS <> '4' AND A.STATUS <> '5') AND (Pass=1 OR (PassP = 1 OR PassC = 1))Now i want to check if Pass = 1 then i have to check whether primaryidentity=1 if it is 1 then i need to check whether identified = 1.how to write query for this condition. |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2007-12-27 : 02:56:59
|
SELECT A.ID, A.Status, B.Identified, B.PrimaryOwner,C.PassP, C.PassC, C.primaryidentityFROM Test1Vw A with (NOLOCK)INNER JOIN Test2Vw B with (NOLOCK) ON B.CID = A.ID INNER JOIN Test3Vw C with (NOLOCK) ON A.CPID = C.ID WHERE (A.STATUS <> '4' AND A.STATUS <> '5') AND ((Pass=1 AND primaryidentity=1 AND identified = 1) OR (PassP = 1 OR PassC = 1)) |
 |
|
|
|
|