Create View with a UNION ?
Posted in 2000
Hello All,
Can you create a view using a UNION statement? I'm new at writing Informix
SQL and I am receiving an error when I execute the SQL below. Any help will
be appreciated.
Thanks!
Gail
CREATE VIEW testgail
(activity,
fiscal_year,
period,
r_system,
atn_obj_id,
tran_amount)AS SELECT
accommitx.activity,
accommitx.fiscal_year,
accommitx.period,
accommitx.r_system,
accommitx.atn_obj_id,
accommitx.tran_amount
FROM
xxxx.accommitx accommitx
WHERE
accommitx.activity = '47049009'
UNION
AS SELECT
actrans.activity,
actrans.fiscal_year,
actrans.period,
actrans.r_system,
actrans.obj_id,
actrans.tran_amount
FROM
xxxx.actrans actrans
WHERE
actrans.activity = '47049009';
REVOKE ALL
on testgail
from public ;
Grant Select
on testgail
to public;