create table newtt as select uid from user_1 where cid=1 union select uid from user_2 where cid=1 union select uid from user_3 where cid=1orSELECT * INTO OUTFILE '/tmp/result.txt' from (select uid from user_1 where cid=1 union select uid from user_2 where cid=1 union select uid from user_3 where cid=1) a
select uid from user_1 where cid=1
union
select uid from user_2 where cid=1
union
select uid from user_3 where cid=1orSELECT * INTO OUTFILE '/tmp/result.txt' from
(select uid from user_1 where cid=1
union
select uid from user_2 where cid=1
union
select uid from user_3 where cid=1) a