Jump to content

Help with random sorting


Riparian

Recommended Posts

I have a table with 2000+ entries with a considerable amount of data per record.

 

This one  table is created from a number of other tables using ....(cut to the bone)

 

mysql_query("Drop Table IF  EXISTS THETABLE ");

 

mysql_query("Create Table IF NOT EXISTS THETABLE select * from table1 where table1.in_stock='T' ");

 

mysql_query("INSERT INTO $DATA.`THETABLE ` SELECT * FROM $DATA.`table2`");

mysql_query("INSERT INTO $DATA.`THETABLE ` SELECT * FROM $DATA.`table3`");

 

etc etc

 

 

The new table is in sequential order as read from the other tables and inserted into THETABLE.

 

What I would like to do is random sort the contents and then recreate THETABLE in that random order .

 

Any help is greatly appreciated.

 

p.s.

Random sorting the table at display time is no good for me as paging through using order by rand() shows duplicates so I think it will be easier and quicker to display without sorting .

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.