In many case we are suppose to add one additonal column in our table and insert data from another column from same table.
In my case, I want to add month column which store only month and year in yyyymm format
ALTER TABLE ebiz1
ADD mont column_type NULL
Insert into column from same table in Oracle |
From the above syntax we will get additonal column in my table ebiz1. After the column is created I need to use UPDATE Statement as below.
UPDATE ebiz1 SET
mont= to_number(to_char(gl_date, 'yyyymm'))
From the Above statement I just copy gl_date column data into month column in yyyymm format
Comments
Post a Comment