I'm sure I'm just missing something basic, but here goes...

I need to create a table, populated with data, from an existing table.  
Easy enough:
"create table TEST select * from OLD_DATA"

Most cool.  Now, let's say OLD_DATA has three columns: A, B, & C.  I 
want to create new table TEST, with all 3 columns from OLD_DATA, 
but.....I want to totally randomize the order of column B.  For example, 
I want to go from:

FIRSTNAME               LASTNAME                PID
bob                             jones                   1
mary                            smith                   2
maddog                  brown                   3

To this:

FIRSTNAME               LASTNAME                PID
bob                             smith                   1
mary                            brown                   2
maddog                  jones                   3

I guess what I'm looking for is something similar to this imaginary 
command:

CREATE TABLE TEST SELECT FIRSTNAME, PID, (LASTNAME ORDER BY RAND()) FROM 
OLD_DATA;

Any help is appreciated.


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to