Today I wanted to add a new column to the table that exists some data. After that, I had to add some data to the that column based on the supplier type.
Supplier type is “VENDOR” then broker must be “Broker B“.
Supplier type is “WHOLE” then broker must be “Broker A“.
Supplier table with a new column.
SET broker =
WHEN type = 'WHOLE' THEN 'Broker A'
WHEN type = 'VENDOR' THEN 'Broker B'
After executing the update query.
Note: – tested on PostgreSQL.
4389total visits,3visits today