This is an example of my view.
create view VIEWTEST as
select
'1' as TYPE,
TABLE1.KEYFIELD1 as KEYFIELD1,
'' as KEYFIELD2,
'' as KEYFIELD3,
TABLE1.FIELDX as FIELD1
from TABLE1
when TABLE1.FIELDS = TABLE2.FIELDS
union all SELECT
'2' as TYPE,
'' as KEYFIELD1,
TABLE2.KEYFIELD10 as KEYFIELD2...
SELECT TABLEA.CODE, TABLEA.DATE, TABLEA.FIELD
FROM TABLEA
where TABLEA.CODE = 'XX'
UNION all
SELECT TABLEB.CODE, TABLEB.XXDATE AS DATE, TABLEB.FIELD
FROM TABLEB
where TABLEB.CODE <> 'ZZ'
UNION all
SELECT TABLEC.CODE, TABLEC.DATE, TABLEC.FIELD
FROM TABLEC
where...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.