Search
 
SCRIPT & CODE EXAMPLE
 

SQL

mysql update field from one table to another

UPDATE MY_TABLE AS t1
INNER JOIN MY_OTHER_TABLE AS t2 ON t1.COLID = t2.COLID
SET t1.COL1 = t2.COL1, t1.COL2 = t2.COL2
WHERE t1.COL3 = 'OK';
Comment

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'
Comment

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'
Comment

PREVIOUS NEXT
Code Example
Sql :: sql convert to linq online 
Sql :: mysql find char in string 
Sql :: SQlite script 
Sql :: sql declare variable single line 
Sql :: t-sql update table variale 
Sql :: sql after date 
Sql :: user defined variables in sql 
Sql :: cassandra query example 
Sql :: AND Operator (AND) 
Sql :: postgresql not in alternative 
Sql :: QUERY JPQL 
Sql :: postgresql < ALL very slow 
Sql :: mysl like insert a variable 
Sql :: mysql reset wp_options 
Sql :: python simple crud application using sqlite 
Sql :: ring MySQL get the result data without columns names 
Sql :: sql gather statistics to increase performance 
Sql :: Second Step in installing SQL workbench 
Sql :: sql insert multiple rows from another table 
Sql :: kill thread 
Sql :: python sqlalcahmey compare datetime using extract 
Sql :: Sauvegarde complète my sql 
Sql :: enter postgres shell o localhost 
Sql :: database db connection string format 
Sql :: Show mysql account privilleges 
Sql :: SQLServerException.makeFromDatabaseError 
Sql :: sql server agent not running 
Sql :: mysql select bottom 10 rows 
Sql :: sql show founctions 
Sql :: distinct 
ADD CONTENT
Topic
Content
Source link
Name
1+4 =