How can I make this PHP script in a one Single SQL statement?
$sql = 'SELECT oxtprice from oxarticles where oxparentid = ? and nrseriesarticle = 1';
$price = DatabaseProvider::getDb()->getOne($sql, [$id]);
if ($price) {
$updateSql = "Update oxarticles SET nrseriestprice = ? WHERE oxid = ? and oxparentid = ''";
DatabaseProvider::getDb()->execute($updateSql, [$price, $id]);
I want something like this but it didn't work
UPDATE oxarticles SET
nrseriesprice = (SELECT oxprice from oxarticles where oxparentid = ? and nrseriesarticle = 1)
WHERE oxid = ?