0

テーブルを作成して2つを使用したいのですが、これが私のコードです:

Create Table profitTry
As
With ctsWithSplit as (select c.Tdate, c.Symbol, c.close * coalesce(s.post/s.pre, 1) as new_close
 from ctsTry c left join splits s 
on c.Tdate = s.Tdate and c.symbol = s.symbol),

delta as
( select a.Tdate as TDate,  a.Symbol as Symbol, a.price-b.price as Pdelta, b.price as oldPrice
   from ctsWithSplit a, ctsWithSplit b
   where a.TDate-b.TDate=1 and a.Symbol=b.Symbol)

select  a.TDate,a.Symbol, (a.delta-coalesce(b.dividend,0))/delta.oldPrice as percentage
From delta a left join dividend b
On a.Tdate=b.Tdate and a.Symbol=b.Symbol

「テーブルが存在しませんでした」というエラーがあります。

4

1 に答える 1

1

1 つの明確な問題は、アウターにありますselect

select  a.TDate,a.Symbol, (a.delta-coalesce(b.dividend,0))/delta.oldPrice as percentage
-----------------------------------------------------------^
From delta a left join dividend b
On a.Tdate=b.Tdate and a.Symbol=b.Symbol

ありませんdelta。つまりa

于 2015-02-20T00:36:57.327 に答える