How to delete part of value from column in teradata sql?

by tressie.damore , in category: MySQL , 5 months ago

How to delete part of value from column in teradata sql?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by domenico , 5 months ago

@tressie.damore 

To delete part of a value from a column in Teradata SQL, you can use the REPLACE function.


For example, if you have a column name in a table employees and you want to remove the word "Company" from all the values in that column, you can use the following SQL query:

1
2
UPDATE employees
SET name = REPLACE(name, 'Company', '')


This query will replace the word "Company" with an empty string in all the values of the name column in the employees table.


Make sure to backup your data before running any update query to avoid any unexpected data loss.

Related Threads:

How to do numerical value comparison in teradata sql?
How to update a column with a null value in teradata?
How to calculate mean value per group in teradata sql?
How to duplicate table row based on column value in teradata?
How to get maximum column values across a row in teradata sql?
How to update only 3 column value in laravel?