Skip to content Skip to sidebar Skip to footer

Copy Column Value From One Table Into Another Matching IDs - SQLite

I want to do exactly what it was described in this question: (Copy Column Value from One table into Another Matching IDs), but in SQLite instead of MySQL. The solution provided: up

Solution 1:

You could try

UPDATE t1 
SET  t1.value = ( 
     SELECT t2.p_value 
     FROM t2 
     WHERE t1.id = t2.parent_id) 

or using you code try

UPDATE t1 
SET value = ( 
  SELECT value 
  FROM t2 
  WHERE t1.id = t2.id)

Post a Comment for "Copy Column Value From One Table Into Another Matching IDs - SQLite"