-1

我想做的是:

一月表

尖点数:1、2、3

电流系数:0.123、0.140、0.045

二月表

尖点数:1、2、3

电流系数:0.184、0.163、0.033

然后是 FEB 表中的一个新列,用于查找每个 CUSIP 号码的二月因子/一月因子的值:

=.123/.184

=.140/.163

ETC..

这是我到目前为止所拥有的,它从上个月提取了因素并将其显示在 2 月表下方

SELECT [CURRENT FACTOR]
FROM DBO.mbs012013, DBO.mbs022013
WHERE DBO.mbs012013.[CUSIP NUMBER] = DBO.mbs022013.[CUSIP NUMBER]
4

2 回答 2

1
Update February 
  Set factor= (1.0 * January.factor/February.factor )
  from February 
  Join Janaury on .... whatever links Febuary to January which had better be a 1-1 join
于 2013-06-19T13:07:52.780 回答
0
  SELECT February.CUSIP, February.factor, (1.0 * January.factor/February.factor ) as Ratio
  from February 
  INNER JOIN Janaury on January.CUSIP = February.CUSIP 
于 2013-06-19T14:24:57.880 回答