create view vi_every_day as (
SELECT date_format(C.ASSIGNED_DATE, '%Y/%m/%d') AS EVERY_DAY
FROM (
    SELECT ('2014/01/01' + INTERVAL ((((T3.I * 1000) + (T2.I * 100)) + (T1.I * 10)) + T0.I) DAY) AS ASSIGNED_DATE
    FROM ((((
        (
            SELECT 0 AS I
        )
        UNION
        SELECT 1 AS `1`
        UNION
        SELECT 2 AS `2`
        UNION
        SELECT 3 AS `3`
        UNION
        SELECT 4 AS `4`
        UNION
        SELECT 5 AS `5`
        UNION
        SELECT 6 AS `6`
        UNION
        SELECT 7 AS `7`
        UNION
        SELECT 8 AS `8`
        UNION
        SELECT 9 AS `9`
    ) T0 JOIN (
        SELECT 0 AS I
        UNION
        SELECT 1 AS `1`
        UNION
        SELECT 2 AS `2`
        UNION
        SELECT 3 AS `3`
        UNION
        SELECT 4 AS `4`
        UNION
        SELECT 5 AS `5`
        UNION
        SELECT 6 AS `6`
        UNION
        SELECT 7 AS `7`
        UNION
        SELECT 8 AS `8`
        UNION
        SELECT 9 AS `9`
    ) T1) JOIN (
        SELECT 0 AS I
        UNION
        SELECT 1 AS `1`
        UNION
        SELECT 2 AS `2`
        UNION
        SELECT 3 AS `3`
        UNION
        SELECT 4 AS `4`
        UNION
        SELECT 5 AS `5`
        UNION
        SELECT 6 AS `6`
        UNION
        SELECT 7 AS `7`
        UNION
        SELECT 8 AS `8`
        UNION
        SELECT 9 AS `9`
    ) T2)
    JOIN (
        SELECT 0 AS I
        UNION
        SELECT 1 AS `1`
        UNION
        SELECT 2 AS `2`
        UNION
        SELECT 3 AS `3`
        UNION
        SELECT 4 AS `4`
        UNION
        SELECT 5 AS `5`
        UNION
        SELECT 6 AS `6`
        UNION
        SELECT 7 AS `7`
        UNION
        SELECT 8 AS `8`
        UNION
        SELECT 9 AS `9`
    ) T3)
) C
WHERE (C.ASSIGNED_DATE BETWEEN (
    SELECT date_format(min(APZL.FLOW_BUSSINESS_OBJECT.INPUTTIME), '%Y-%m-%d') FROM APZL.FLOW_BUSSINESS_OBJECT
) AND now()));

