I want to insert the resultant rows of a query into another table. How can I perform this? Kindly help.

To better understand my question I simply execute the following query where I want the value of columnA to be the value of the column of the next row of the select statement in each iteration. 

```
while exists (Select columnA from tableA where SOMECONDITION)
begin
    insert into tableB(columnA,Value1,Value2)
end

```