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 |
chavamex2604
Starting Member
1 Post |
Posted - 2011-04-01 : 10:58:02
|
Hi i have the following querySELECT eol,Goods,Fails,(((Goods*100)/Fails)) AS "%Yield" FROM (select testname as eol from eoldata group by testname) Wcross join(SELECT Testname,COUNT(*) as Goods FROM eoldata where dates between '3/31/2011 06:00:00' and '3/31/2011 16:00:00' and status='OK' group by testname) Y CROSS JOIN (SELECT COUNT(TestName) AS Fails FROM eoldata where dates between '3/31/2011 06:00:00' and '3/31/2011 16:00:00'group by testname) Zbut when i get the result it show PCBW302 564 626 90PH2EOL1 564 626 90EOL01 564 626 90EOLchimes 564 626 90blank space and again same information but diferen valuesPCBW302 25 626 3PH2EOL1 25 626 3EOL01 25 626 3EOLchimes 25 626 3it supose to group by first column |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2011-04-01 : 11:45:46
|
You should read in books online what a cross join is doing. No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
|
|