database - How can I write a SQL statement to update a column in a table from another column in the same table? -


I have an Oracle DB where a program writes in two columns when it updates the table in the second column 1 column Based on the price. For a long time people have edited the database manually and forgot to include value in 2 columns. I want to write a simple SQL statement which updates all the columns and syncs 2 columns in 1 column. I know that there is some simple statement to do this. To make a little Google I thought something like the following:

  Contact the updater suppliers - supplier_name = (Choose customer name from customers where customer customers.Customer_id = suppliers.supplier_id) (Existing customers select Name FROM customers where customer customers.Customer_id = suppliers.supplier_id);  

However, it is between 2 separate tables where I am doing it on the same table.

Believes that both columns are not zero if the columns are faucetable, then its Use decoded instead:

  set_table_table column 1 column = 2 column WHERE decode (column1, column2, 1, 0) = 0;  

Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -