I have 2 tables xcart_products which has productid , meta_description
and many other fields . The 2nd table is xcart_extra_field_values which has ( productid fieldid and value
)
I need to copy the value of fieldID = 1
of xcart_extra_field_values
into
the meta_description
column of the xcart_products
table where the Productid
are same.
UPDATE `xcart_products` SET meta_description = ( SELECT value FROM
xcart_extra_field_values WHERE fieldid = 1 AND
xcart_extra_field_values.productid = xcart_products.productid )
WHERE
xcart_extra_field_values.productid = xcart_products.productid ;
I wrote the above SQL but i am getting an error
#1054 - Unknown column 'xcart_extra_field_values.productid' in 'where clause'