Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

mysql update table from another table

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: #mysql #update #table #table
ADD COMMENT
Topic
Name
5+3 =