创建季度和年份的组合(teradata)

时间:2018-06-28 08:30:32

标签: sql teradata

这可以简化吗?

SELECT 
        *
FROM 
(
        SELECT * FROM (SELECT 1 AS Quarter) AS Q1
                UNION 
        SELECT * FROM (SELECT 2 AS Quarter) AS Q2
                UNION 
        SELECT * FROM (SELECT 3 AS Quarter) AS Q3
                UNION 
        SELECT * FROM (SELECT 4 AS Quarter) AS Q4
) AS IQ1
CROSS JOIN 
(
        SELECT * FROM (SELECT 2000 AS Y) AS Q1
                UNION 
        SELECT * FROM (SELECT 2001 AS Y) AS Q2
) AS IQ2 

0 个答案:

没有答案