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 |
cutiebo2t
Constraint Violating Yak Guru
256 Posts |
Posted - 2008-03-31 : 03:24:12
|
Here's my sample formula:SELECT dbo.TechphonesCalibQA.ID, dbo.TechphonesCalibQA.EmpID, dbo.TechphonesCalibQA.EmpName, dbo.TechphonesCalibQA.[Level], CASE dbo.TechphonesCalibQA.G_Branded WHEN dbo.TechphonesCalibClient.G_Branded THEN 1 ELSE 0 END AS G_BrandedFROM dbo.TechPhonesCalibClient INNER JOIN dbo.TechphonesCalibQA ON dbo.TechPhonesCalibClient.SesID = dbo.TechphonesCalibQA.SesIDI would like to get the average of column G_branded (Result from the above formula) Any idea?Thanks |
|
pravin14u
Posting Yak Master
246 Posts |
Posted - 2008-03-31 : 04:19:51
|
Average for each Employee?Prakash.PThe secret to creativity is knowing how to hide your sources! |
|
|
cutiebo2t
Constraint Violating Yak Guru
256 Posts |
Posted - 2008-03-31 : 06:33:11
|
for everyone |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-03-31 : 13:13:16
|
[code]SELECT AVG(t.G-Branded)FROM(SELECT dbo.TechphonesCalibQA.ID, dbo.TechphonesCalibQA.EmpID, dbo.TechphonesCalibQA.EmpName, dbo.TechphonesCalibQA.[Level], CASE dbo.TechphonesCalibQA.G_Branded WHEN dbo.TechphonesCalibClient.G_Branded THEN 1 ELSE 0 END AS G_BrandedFROM dbo.TechPhonesCalibClient INNER JOINdbo.TechphonesCalibQA ON dbo.TechPhonesCalibClient.SesID = dbo.TechphonesCalibQA.SesID)t[/code] |
|
|
|
|
|