SELECT "company_name",
DATEDIFF( 'DD', '1899-12-30', TO_CHAR( CURDATE( ), 'YYYY-MM-' ) + "integer" ) AS "Zahltag"
FROM "company", "integer"
UNION SELECT ALL "company_name",
DATEDIFF( 'DD', '1899-12-30', TO_CHAR( CURDATE( ), 'YYYY-MM-' ) + "payday2" ) AS "Zahltag"
FROM "company"
The above works fine as a query but only the first select will be accepted as a view. The UNION SELECT will trigger the error "The given command is not a select statement. Only queries are allowed."
SELECT "company_name",
DATEDIFF( 'DD', '1899-12-30', TO_CHAR( CURDATE( ), 'YYYY-MM-' ) + "integer" ) AS "Zahltag"
FROM "company", "integer"
UNION SELECT ALL "company_name",
DATEDIFF( 'DD', '1899-12-30', TO_CHAR( CURDATE( ), 'YYYY-MM-' ) + "payday2" ) AS "Zahltag"
FROM "company"
The above works fine as a query but only the first select will be accepted as a view. The UNION SELECT will trigger the error "The given command is not a select statement. Only queries are allowed."