Initially, I am getting an error " Column qualifier or table OEINDLID undefined. "
ここで行ったことは、Crystal Report によって作成された SQL を取得し、そこからビューを作成しようとすることです...
CREATE VIEW astccdta.acsusage
AS
SELECT ICPRTMIA.IARCC9, OEINDLID.IDDOCD, OEINDLID.IDCOM#,
ADRESSAD.ADSFX#, OEINDLID.IDPRT#, OEINDLID.IDGRC#, OEINDLID.IDENT#,
OEINDLID.IDSFX#, OEINDLID.IDPRLC, OEINDLID.IDNTU$, OEINDLID.IDSHP#,
ADRESSAD.ADFNM, ADRESSAD.ADLNM, OEINHDIH.IHVIAC, ADRESSAD.ADSTTC,
OEINDLID.IDINV#, (
SELECT
SUM (T01.IDNTU$)
FROM
ASTDTA.OEINDLID T01
WHERE
T01.IDCOM# = '001' AND
T01.IDDOCD = OEINDLID.IDDOCD AND
T01.IDINV# = OEINDLID.IDINV# AND
T01.IDPRLC LIKE 'F%'
)
FROM (ASTDTA.OEINDLID
INNER JOIN ASTDTA.ICPRTMIA ON OEINDLID.IDPRT#=ICPRTMIA.IAPRT#)
INNER JOIN (ASTDTA.ADRESSAD
INNER JOIN ASTTRN.OEINHDIH ON ADRESSAD.ADENT#=OEINHDIH.IHENT#)
ON OEINDLID.IDIDC#=OEINHDIH.IHIDC#
WHERE ICPRTMIA.IARCC9='ACS'
OEINDLID.IDCOM#='001'
AND OEINDLID.IDPRT# LIKE 'ACS%'