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 |
|
petev
Starting Member
1 Post |
Posted - 2010-09-15 : 14:24:48
|
| Below is a statement that give me the results as follows:--------------------Tester | Total_Target_Cycletester1 | 5tester2 | 6I am trying to figure out how i can get total_defects column with only open defects only and percent changet between the target cycle and total defects.------------------------------------------------------Tester | Total_Target_Cycle | Total_Defects| % Change------------------------------------------------------tester1 | 5tester2 | 6HOW TO COMBINE THE TWO STATEMENTS BELOW. THANKSselect BG_detected_by Tester,COUNT(*)Total_Target_CycleFrom Bugwhere BG_STATUS = 'Open'and BG_TARGET_RCYC IS NOT NULLGROUP by BG_DETECTED_BY, BG_STATUS,BG_TARGET_RCYCselect bg_detected_by tester, count(*) Totalfrom bugwhere bg_status = 'Open'group by bg_status,bg_detected_by |
|
|
GhantaBro
Posting Yak Master
215 Posts |
Posted - 2010-09-15 : 17:10:49
|
| check subquery or with CTE in google. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-09-16 : 12:25:26
|
| [code]select COALESCE(q1.Tester,q2.Tester) AS Tester,COALESCE(Total_Target_Cycle,0) AS Total_Target_Cycle,COALESCE(Total,0) AS Total_Defectsfrom query1 q1FULL JOIN query2 q2On q1.tester= q2.tester[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|