Reputation: 28349
Without writing a stored procedure loop, is it possible to insert into a table 100 times setting some column's value to whatever iteration it's at within the "loop" (1-100).
Upvotes: 1
Views: 53
Reputation: 360672
Cheap hack:
select @val := 1;
insert into yourtable (valfield) select (@val := @val + 1) from any_existing_table where @val < 100;
[edit] Mark, I edited your answer so that I could mark it as correct. -Dr.D [end edit]
Upvotes: 1