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 |
|
confusedintern
Starting Member
1 Post |
Posted - 2007-06-06 : 16:35:02
|
| Hi, I had someone help me refine results to show results that have data that match 2 tables. I then created a column of values from the two tables but how do i take the average of that column? my original script looks something like this:select a.day, a.time, a.cname, sum(T_GS), sum(T_CS), sum(T_CS)/sum(T_GS) Cost,sum(T_OPEX), sum(T_CS)/10/sum(T_OPEX) PERCENT from Fs_b12 a, Fs_b7 bwhere a.day=2005 and b.day=2005 and a.time=b.time and a.carrier_name=b.carrier_name group by a.day, a.time, a.cnameorder by a.cname, a.time |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-06-06 : 21:43:18
|
use AVG() ? KH |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-06-07 : 10:08:46
|
| or post some sample data with expected resultMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|