Q:

Can't create a new table with UNION ALL

SQL executes this piece of code (t1 and t2 have identical structure)
 SELECT * FROM `t1` UNION ALL SELECT * FROM `t2`

but not this one: 
CREATE TABLE `test` AS (
SELECT * FROM `prospects-non-clients-valid-quote-images-solo` 
UNION ALL
SELECT * FROM `prospects-non-clients-valid-quote-images-duet` )

I get the following error message: 

"1064 - You have an error in your SQL syntax; check the manual that
  corresponds to your MySQL server version for the right syntax to use
  near 'UNION ALL SELECT * FROM t2 )' at line 3

What am I missing?  
Thank you for your help! 

A:

Assuming the UNION ALL works, use a SELECT * from outside:
CREATE TABLE `test` AS select * from (
SELECT * FROM `prospects-non-clients-valid-quote-images-solo` 
UNION ALL
SELECT * FROM `prospects-non-clients-valid-quote-images-duet`) t

I'd advise you to explicitly specify column names in the query instead of * as the table schemas ten to change with time.