I just practice using Bigquery & try to use one of my SQL query on it
declare @id int
select @id = 1
while @id >=1 and @id <= 1000
begin
inser
It is not the best practice to use cursor-based logic when dealing with sql, rather you need to tune yourself into set-based processing. Especially with BigQuery which does not support [yet] cursor processing and procedural logic, but luckily has rich support for ARRAYs which can be used here
As your question is little abstract - below example is abstract too, but gives you an idea
#standardSQL
INSERT INTO `project.dataset.Quincy` (id, col)
WITH array_to_loop_through AS (
SELECT id
FROM UNNEST(GENERATE_ARRAY(1, 1000, 1)) id
)
SELECT id, CONCAT('Rank: ', CAST(id AS STRING))
FROM array_to_loop_through