CREATE TABLE PRODUCT_TB SELECT * FROM
(
SELECT DATEBUY , MBCODE , PRDID, QTY FROM 20090101
UNION ALL
SELECT DATEBUY , MBCODE , PRDID, QTY FROM 20090102
UNION ALL
SELECT DATEBUY , MBCODE , PRDID, QTY FROM 20090103
UNION ALL
SELECT DATEBUY , MBCODE , PRDID, QTY FROM 20090104
UNION ALL
SELECT DATEBUY , MBCODE , PRDID, QTY FROM 20090105
)
CREATE TABLE PRODUCT_TB SELECT * FROM
(
SELECT DATEBUY , MBCODE , PRDID, QTY FROM 20090101
UNION ALL
SELECT DATEBUY , MBCODE , PRDID, QTY FROM 20090102
UNION ALL
SELECT DATEBUY , MBCODE , PRDID, QTY FROM 20090103
UNION ALL
SELECT DATEBUY , MBCODE , PRDID, QTY FROM 20090104
UNION ALL
SELECT DATEBUY , MBCODE , PRDID, QTY FROM 20090105
)
CREATE TABLE PRODUCT_TB SELECT * FROM
(
SELECT DATEBUY , MBCODE , PRDID, QTY FROM 20090101
UNION ALL
SELECT DATEBUY , MBCODE , PRDID, QTY FROM 20090102
UNION ALL
SELECT DATEBUY , MBCODE , PRDID, QTY FROM 20090103
UNION ALL
SELECT DATEBUY , MBCODE , PRDID, QTY FROM 20090104
UNION ALL
SELECT DATEBUY , MBCODE , PRDID, QTY FROM 20090105
) as xxxx
SELECT * INTO PRODUCT_TB
FROM (
SELECT DATEBUY , MBCODE , PRDID, QTY FROM 20090101
UNION ALL
SELECT DATEBUY , MBCODE , PRDID, QTY FROM 20090102
UNION ALL
SELECT DATEBUY , MBCODE , PRDID, QTY FROM 20090103
UNION ALL
SELECT DATEBUY , MBCODE , PRDID, QTY FROM 20090104
UNION ALL
SELECT DATEBUY , MBCODE , PRDID, QTY FROM 20090105
) AS Table_Name