私は製品テーブルに1トンの製品を持っています。各製品にはproduct_specificationがあります。私はすべてのproduct_specification.document_type_idを '2'の値に更新する必要があります。ここでのSO熟読しながら、私が思い付いたものです:select..where..inとjoinで複数の行を更新する
update product_specifications
set product_specifications.document_type_id = 2
inner join products
on products.product_specification_id = product_specifications.id
where products.id in (
select p.id from products as p
inner join product_specifications as ps
on p.product_specification_id = ps.id
where p.store_front_id = 71
and ps.document_type_id = 1)
しかし、これは動作しません...
どのようなエラードキュメントのですか? –