Just put the result of your subquery in a temporary table and use it as a join to populate the other one.
Code:
CREATE TEMPORARY TABLE singleuin as SELECT MAX(uin) as maxuin FROM table1 GROUP BY body;
CREATE TABLE table2 AS SELECT table1.* FROM table1 JOIN singleuin ON table1.uin = singleuin.maxuin;
Once your mysql session finishes the singleuin temporary table will disapear living only table 1 and table 2
On the other hand, you can do this in only one query
Code:
CREATE TABLE table2 AS SELECT MAX(uin), name, email, body FROM table1 GROUP BY body;
Meanwhile... my prefered method would be to create the empty table and populate it with an 'insert into... select' statement.
Code:
CREATE TABLE `table2` (
`uin` int(11) NOT NULL auto_increment,
`name` varchar(50) not null,
`email` varchar(100) not null,
`body` blob,
PRIMARY KEY (`uin`)
);
INSERT INTO table2 (uin, name, email, body) SELECT MAX(uin), name, email, body FROM table1 GROUP BY body;