I need to create a derived column like in SQL Server http://msdn.microsoft.com/en-us/library ... .105).aspx
A computed column is not physically stored on disk, but rather computed each time it is queried. What I really want from this functionality is that I can change the expression by which this column is computed and get the same effect as if I updated this column for all the rows. Example :
Code: Select all
create table comp(a INT, b INT, result float AS b/a); (<< this syntax doesn't work on vertica 6.0)
insert into comp values(4,8)
select * from comp;
a | b | result
==================
4 8 2
when I change the equation b/a by something else like b+2*a for example...then i query the table again, I should see :
Code: Select all
select * from comp;
a | b | result
==================
4 8 16
How can I do this in Vertica ?
(I know there's an option to specify the DEFAULT value as an equation/expression, but this doesn't give the effect I want, because the column is physically stored.)