I have a column of order_date in a table named dates:
order_date
"2011-02-01"
"2012-03-23"
"2011-01-01"
"2011-07-04"
I'm trying to extract the dates and add it to a new column. I used the formula
select EXTRACT(day from order_date)
from dates
to get the dates from the column.
Now to add the values in another column in I tried the following:
update dates
set date1 = select EXTRACT(day from order_date) from dates;
But unfortunately the above code is not working and gives me an error at the 'select' part.