Updating table in oracle


08-May-2019 19:18

How can I change just the affected addresses in the contact database, assuming the username portion of their e-mail addresses remains the same?UPDATE contacts.email ce SET email = ( SELECT REPLACE(email, '@osric.com', 'example.com') FROM contacts.email e INNER JOIN contacts.contact c ON e.contact_id = WHERE c.dept_id = 'oracle' AND e.email LIKE '%@osric.com' ) WHERE EXISTS ( SELECT 1 FROM contacts.email e INNER JOIN contacts.contact c ON e.contact_id = WHERE c.dept_id = 'oracle' AND e.email LIKE '%@osric.com' ); UPDATE contacts.email ce SET email = ( SELECT REPLACE(email, '@osric.com', '@example.com') FROM contacts.email e INNER JOIN contacts.contact c ON e.contact_id = WHERE c.dept_id = 'oracle' AND e.email LIKE '%@osric.com' AND ce.contact_id = e.contact_id ) WHERE EXISTS ( SELECT 1 FROM contacts.email e INNER JOIN contacts.contact c ON e.contact_id = WHERE c.dept_id = 'oracle' AND e.email LIKE '%@osric.com' AND ce.contact_id = e.contact_id ); That joins the rows from the parent UPDATE query with the rows from the SELECT subquery.

What is the SQL update syntax to update more than one column?This process of extracting the elements of a collection is called refers to a LOB object attribute, then you must first initialize it with a value of empty or null. Also, if you are updating a LOB value using some method other than a direct to set the column to the value previously specified as the default value for the column.