I am new to MySQL (have just been using SQL Server) and I am wondering how to create multiple rows easily!
I am looking to create about 300 rows, so the methods I have found online just don't seem practical enough..
When using SQL Server, you can just use a GO statement, and then enter a number afterwards and it will run the command that many times, such as : GO 50
Is there anything as simple as this on MySQL? I have read about using a loop statement, but I cannot find any info on it?
Any help will be really appreciated!
Thanks,
-Liam.
You may prepare you data with Excel, export as CSV and import to DB by common Database Tools like DBeaver and Sql Squirrel
https://github.com/dbeaver/dbeaver/issues/722
You could create a Repeat statement:
It's basically a loop, where you put the condition using UNTIL. Here it is used in a function but you can adapt it to your needs.
Without using loop:
DBFiddle Demo MySQL 8.0+