Q
Problem solve Get help with specific problems with your technologies, process and projects.

Update a specific column in a field or row?

An Oracle user asks if SQL can be used to update a specific column in a field.

Is it possible to update a specific column in a field without changing the value of the other columns in the same field?

The simple answer is no. The reason it's not possible is because database tables don't have fields, just rows and...

columns. Columns are not contained in fields.

Perhaps you meant "Is it possible to update a specific column in a row without changing the value of the other columns in the same row?"

The answer then is yes. Regardless of the number of columns defined for the table, you have complete control over exactly how many values you update.

Example of updating a specific column in a specific row without changing anything else:

UPDATE personnel
   SET salary = salary * 1.10
 WHERE emp_id = 937

In the above example, only one column value (salary) is being updated, for only one employee (937).

Example of updating a specific column in multiple rows without changing any other column values:

UPDATE personnel
   SET salary = salary * 1.05
 WHERE job_code = 4

In this example, only one column value (salary) is being updated, but this value is updated for all employees which have a job code of 4. Again, no other columns are updated.

This was last published in July 2008

Dig Deeper on Oracle development languages

PRO+

Content

Find more PRO+ content and other member only offers, here.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close