Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

sql add calculated column

-- MySQL / Oracle:
ALTER TABLE table_name ADD double_count NUMBER(10, 2)
    GENERATED ALWAYS AS (account * 2) VIRTUAL;
    
-- SQL Server
ALTER TABLE table_name ADD [double_count] AS (account * 2);
Source by www.mysqltutorial.org #
 
PREVIOUS NEXT
Tagged: #sql #add #calculated #column
ADD COMMENT
Topic
Name
9+2 =