I am trying to run this simple WHILE loop in pgAdmin's query tool:
DECLARE @counter INT = 1;
WHILE @counter <= 5
BEGIN
PRINT @counter;
SET @counter = @counter + 1;
END
The desired result is just a list from 1 to 5, but my pgAdmin is returning this error: *ERROR: syntax error at or near "@" LINE 1: DECLARE @counter INT = 1;
I'm an undergrad in a non-IT course, so I hope you consider this in your explanations. Thank you! (code source)