sql server - Take Average of two columns sql -
Select the
age; average (shoes size) from (dbo) [Transactions] T2 Where t2.age = T 1. Edge and T2. Childgen = 'Male') In avg_male, select average (shoes size) from [dbo]. [Transaction] T2 where T2ege = T1 .ge and T2. Childgender = 'female') avg_female [dbo]. [Transaction] T1 Group Age ORDER Age Hello, I have two columns, and I know how I take the average of two columns and displayed in the third part I would. Please help
Just use simple math: choose
Edit with avg_male, avg_female, (Avg_male + avg_female) / 2 transactions:
I think this should work. Not a SQLFiddle, but it should:
Select the age, the amount (case when childgender = 'male' happens then zero to the rest 0) / zodiac (in case when the child-gender = 'Male' then 1 Avg_male, avg_male, avg_male, avg_male, (sumg_male), sum (in case when hair-gender = 'female' then shoe size and 0 end) / zodiac (case when child-gender = 'Female' then 1 and 0 in the form of avg_male, avg_both [dbo]. [Transaction] age 1 to 1 age of age ORDER age
Comments
Post a Comment