Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

update a table column from another table in mysql

UPDATE tableB
INNER JOIN tableA ON tableB.name = tableA.name
SET tableB.value = IF(tableA.value > 0, tableA.value, tableB.value)
WHERE tableA.name = 'Joe'
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #update #table #column #table #mysql
ADD COMMENT
Topic
Name
9+9 =