1 0 Tag Archives: update
post icon

MS SQL Server Update multiple table

Table A will be updated with data from Table B

UPDATE A
    SET A.NAME = B.NAME
FROM TableNameA A, TableNameB B
WHERE A.ID = B.ID
Leave a Comment
post icon

How to remove white space in a mysql field?

Execute SQL Command

UPDATE Country set State_Name = TRIM(State_Name);

Where State_Name in function TRIM hold values with spaces, and TRIM Function removes any white spaces and update the field in same table.

Leave a Comment
post icon

Update MySQL data from two tables

update node_revisions one, content_news_image two
set one.image = two.image_value
where one.nid = two.nid

 

Ex 2

update tbl_news one, term_node two
set one.description = two.description
where one.vid = two.vid

tbl_news – name of the table to be updated
term_node – name of table which hold data
one.description – name of the field where data is going (being updated)
two.description – name of the field FROM where data is hold

 

 

Leave a Comment