vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I want to generate a bunch (10000-100000) of sample records in a table with IDs from N to N+K-1. which is equivalent to: insert into `mytable`.`myfield` (id) values (2000),(2001),(2002), (2003),(2004); except instead of having to write out numbers manually, I want to generate records automatically. Here N = 2000, K=5. what's the easiest way to do this? (preferably in sql but if there is another easy way, I'm open to hearing it) |
| |||
| On Apr 27, 5:24 pm, Jason S <jmsa...@gmail.com> wrote: > I want to generate a bunch (10000-100000) of sample records in a table > with IDs from N to N+K-1. which is equivalent to: > > insert into `mytable`.`myfield` (id) values (2000),(2001),(2002), > (2003),(2004); > > except instead of having to write out numbers manually, I want to > generate records automatically. Here N = 2000, K=5. > > what's the easiest way to do this? (preferably in sql but if there is > another easy way, I'm open to hearing it) I don't know if it's exactly what you're after, but back in June of last year Giuseppe Maxia describe a method for doing this sort of thing with dates, words and numbers all purely within mysql. http://tinyurl.com/26xf2j HIH |
| ||||
| On Apr 28, 9:22 am, strawberry <zac.ca...@gmail.com> wrote: > I don't know if it's exactly what you're after, but back in June of > last year Giuseppe Maxia describe a method for doing this sort of > thing with dates, words and numbers all purely within mysql. > > http://tinyurl.com/26xf2j > > HIH thanks, that's the kind of thing. clever! |