sql - Oracle Creating Table using Data from Previous Tables with Calculations -


i have 2 tables, cts(time, symbol, open, close, high, low, volume) , dividends(time, symbol, dividend). attempting make third table named, dividend_percent columns time, date , percent. percentage dividend believe formula ((close-(open+dividend))/open)*100.

the request exceeded size allowed oraclexe , failed don't believe request should have been big.

sql> create table dividend_percent 2 (select c.time, c.symbol, (((c.close-(c.open+d.dividend))/c.open)*100) p rcnt 3 cts c inner join dividend d 4 on c.symbol=d.symbol); cts c inner join dividend d * error @ line 3: ora-12953: request exceeds maximum allowed database size of 11 gb

am writing query wrong or in such way that's inefficient? 2 tables big don't think big.

perhaps make view combines 2 tables , performs necessary calculations when needed:

create view dividend_percent_view   select c.time,          c.symbol,           ((c.close - (c.open + d.dividend)) / c.open) * 100 prcnt     cts c     inner join dividend d       on c.symbol = d.symbol ,          c.time = d.time     c.open <> 0; 

this avoid duplicating data, eliminate need store twice, , perform prcnt calculation data added after view created pre-existing data.

share , enjoy.


Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -