computed column calculate a value based on different table
        Posted  
        
            by adnan
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by adnan
        
        
        
        Published on 2010-05-04T21:10:36Z
        Indexed on 
            2010/05/04
            21:18 UTC
        
        
        Read the original article
        Hit count: 243
        
i've a table c_const
 code  |  nvalue
 --------------
 1     |  10000
 2     |  20000  
and i've another table t_anytable
 rec_id |  s_id  | n_code
 ---------------------
 2      |  x     | 1
now i want to calculate the x value with computed column, based on
 rec_id*(select nvalue from c_const where code=ncode)
but i get error "Subqueries are not allowed in this context. Only scalar expressions are allowed."
how can i calculate the value in this computed column ?
thanks.
© Stack Overflow or respective owner