如何将内容从具有where子句的一个表复制到同一表的另一个where子句?
因此,“选择查询”将是:SELECT * FROM items where where countryNr = 5;
我现在想将上述查询中的所有数据插入到例如countryNr = 1中。
因此,countryNr = 5和CountryNr = 1最终应该具有相同的数据。
您所描述的更像是一个UPDATE而不是INSERT ...在这种情况下,您的查询可能是这样的:
update item
set (field1, field2) = (select field1, field2 from item where countrNR = 5)
where countrNR = 1
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句