1 SHE第一封email:
select distinct Test.Name,Test.ID,Plan_Device.ID from Test,Plan_Device where Test.ID in(select TestID from TestResult where (StatusID=1 || StatusID=2)
and PlanResultID=(select ID from PlanResultwhere Sessionid='tangzm_ASBSH2_20131204_10371' and PlanID=(select ID fromTestPlan where Name='MEG_DS3_RRA_FT_MCM3_003')))
and Test.TestPlanID=Plan_Device.TestPlanID
select Test.Name,Test.IDfrom Test,AssociateTest where (AssociateTest.TestID=69721or AssociateTest.AssoccaseID=69721) and
(Test.ID=AssociateTest.AssoccaseID orTest.ID=AssociateTest.TestID);
2 ME第二封email:
SELECT DISTINCTTest.Name,Test.ID,Plan_Device.ID
FROMTest,Plan_Device,AssociateTestWHERE Test.ID IN (SELECT TestID FROM TestResult WHERE (StatusID=1 ||StatusID=2)
AND PlanResultID=(
SELECT ID FROM PlanResult WHERE Sessionid='tangzm_ASBSH2_20131204_10371' ANDPlanID=(SELECT ID FROM TestPlan WHERE NAME='MEG_DS3_RRA_FT_MCM3_003')))
ANDTest.TestPlanID=Plan_Device.TestPlanID
and (AssociateTest.TestID=Test.ID ORAssociateTest.AssoccaseID=Test.ID)
AND (Test.ID=AssociateTest.AssoccaseID ORTest.ID=AssociateTest.TestID);
select Test.Name,Test.IDfrom Test,AssociateTest where (AssociateTest.TestID=69721or AssociateTest.AssoccaseID=69721) and
(Test.ID=AssociateTest.AssoccaseID orTest.ID=AssociateTest.TestID);
应该显示两行结果,一行是AssociateTest.TestID=69721查询出来的,另一行是AssociateTest.AssoccaseID=69721查询出来的
SELECTTest.Name,Test.ID,TP.Plan_Device_IDFROM Test,AssociateTest,(
SELECTDISTINCT Test.Name,Test.ID,Plan_Device.ID Plan_Device_ID
FROM Test,Plan_DeviceWHERE Test.ID IN (SELECT TestID FROM TestResult WHERE (StatusID=1 ||StatusID=2)
ANDPlanResultID=(
SELECT ID FROM PlanResult WHERE Sessionid='tangzm_ASBSH2_20131204_10371' ANDPlanID=(SELECT ID FROM TestPlan WHERE NAME='MEG_DS3_RRA_FT_MCM3_003')))
ANDTest.TestPlanID=Plan_Device.TestPlanID
)TP
WHERE(AssociateTest.TestID=TP.IDOR AssociateTest.AssoccaseID=TP.ID)AND (Test.ID=AssociateTest.AssoccaseID OR Test.ID=AssociateTest.TestID);