in reply to SQL solution or Perl solution?

I agree that some clarification is needed. If this is just for a lookup table there's no need to randomly duplicate data, as you can just have a lookup table with an integer key and have the outside code that does the lookup use a rand() or some other function to derive a random entry from the table. I'll wait for some more explanation, too.

---
echo S 1 [ Y V U | perl -ane 'print reverse map { $_ = chr(ord($_)-1) } @F;'

Replies are listed 'Best First'.
Re^2: SQL solution or Perl solution?
by dsheroh (Monsignor) on Nov 06, 2007 at 21:11 UTC
    You actually don't even need to do that...
    select * from my_table order by rand();
    will tell MySQL to randomize the record order. I assume most other database engines have a similar capability, although I wouldn't necessarily expect the syntax to be the same.
      I didn't recognize 'identity' so I didn't think this was MySQL. I think it's either SQL Server or Sybase because of the TSQL part. Inserting random strings via perl is easy. Use Perl's DBI package. Like the rest of you, I'm waiting for some more clarification.
      --
      I used to drive a Heisenbergmobile, but every time I looked at the speedometer, I got lost.
    A reply falls below the community's threshold of quality. You may see it by logging in.