| Author |
Topic |
|
Stoad
Freaky Yak Linguist
1983 Posts |
Posted - 2003-11-20 : 12:16:50
|
| table t------v------11.07... ...25.2232.68Get multiplication: 11.07*...*...*25.22*32.681. Number of rows is unknown.2. Don't mind possible overflow. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2003-11-20 : 12:25:58
|
| Stoad, perhaps if you explained it better then people might bite on this. As of now, I don't have any idea what you are asking.Tara |
 |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2003-11-20 : 12:36:03
|
| set @result = 1select @result=@result * v from tselect @result- Jeff |
 |
|
|
Granick
Starting Member
46 Posts |
Posted - 2003-11-20 : 12:44:52
|
| That is a really simple solution. Way shorter than what I was trying out. Shannon |
 |
|
|
Stoad
Freaky Yak Linguist
1983 Posts |
Posted - 2003-11-20 : 13:11:15
|
| Ahhh.. of course, Jeff, it's OK!But how about one single query without usingany variables and temp tables? |
 |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2003-11-20 : 13:38:44
|
| if i recall .... there is a formula out there using logorithms or something like that where you can do this ..... where was that ?!- Jeff |
 |
|
|
Granick
Starting Member
46 Posts |
Posted - 2003-11-20 : 13:42:39
|
| Jeff you are right, I did a little searching, and found that the following works.SELECT EXP(SUM(LOG(v))) FROM tI wish I could take credit for it, but sadly, I found it using google.Shannon |
 |
|
|
Stoad
Freaky Yak Linguist
1983 Posts |
Posted - 2003-11-20 : 13:58:14
|
| Haha!!.. OK, that's done! :) |
 |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
|
|
Stoad
Freaky Yak Linguist
1983 Posts |
Posted - 2003-11-20 : 15:32:59
|
| Nothing new under the moon.. aahhh.. |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2003-11-20 : 15:34:59
|
| So the point was multiplication of a column? I had seen Jeff's solution on mssqlserver.com as one of the tips a while back. I never knew that you could do that.Tara |
 |
|
|
|