Rob Desbois wrote (06-06-2006 15:22):
Rob, to clarify, your new 'index' column will be based on the value of the 'part' column and individual column names from the old table?
That is correct.

Perhaps something like this, where [colnum] is derived from column name like p1? (part+1)*[colnum]
The actual formula I want to use is:
   `index` = (30 * part) + [colnum]

The problem is I don't know how to implement this in an SQL statement - what I 
want is something like an INSERT...SELECT which can split the SELECTed columns 
of a single row (id, c1, c2, c3) into multiple rows in the INSERT: (id, 1, c1), 
(id, 2, c2), (id, 3, c3).
Afaik there is no such thing so I need an equivalent method - one that isn't 
going to kill my server (like the several attempts I've made so far!)

Run 30 INSERT ... SELECT  ...
One for each column.

--
René Seindal ([EMAIL PROTECTED])






--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to