I’ve created a new table with a few columns, all of which start out as NULL.
I have another table called “items” with a column called “item_type”. This column contains a lot of duplicates. I want to take the values generated by DISTINCT(item_type) and use them to fill one of the new empty columns in my new table. I tried this, but I can’t get it to work:
UPDATE new_table
SET new_column = DISTINCT(items.item_type)
FROM items
Do I need to generate a new table and then join the two?
Better populate the table in such a way:
or
if table is already populated – you need to provide some behavior connecting these tables