Insert INTO a table combining * with a column value
You can do it this way
$pr1 = &quot;INSERT INTO B SELECT *, 0 col10 FROM A where A.id &gt; $limitid&quot;

But this code is vulnerable to sql injection  so use only prepared statemenst with parameters see https://stackoverflow.com/questions/60174/how-can-i-prevent-sql-injection-in-php