how can I use loop 'for' through a table in SQL to check if a column is 0?
I need to do like this in a stored procedure:
for each record in tablex
if table.column1=0 then
insert into table1;
Else
insert into table2;
End for;