1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| CREATE VIEW NEW_VIEW15(
ECKTSOC,
ECKTNUMERO,
ECCTNOM,
ECCJCRE,
LCKTNUMERO,
LCCJDEREX,
LCCTSOLACE,
LCKTSOC,
LCCTCODE,
LCCTSOLACC,
LCCJDERCO,
LCCTNATURE
) AS
select ECOMCLI.ecktsoc, ECOMCLI.ecktnumero, ECOMCLI.ecctnom,
ECOMCLI.eccjcre, LCOMCLI.lcktnumero, LCOMCLI.lccjderex,
LCOMCLI.lcctsolace, LCOMCLI.lcktsoc, LCOMCLI.lcctcode,
LCOMCLI.lcctsolacc, LCOMCLI.lccjderco, LCOMCLI.lcctnature
from ECOMCLI, LCOMCLI
where (
ECOMCLI.ECKTSOC = LCOMCLI.lcktsoc
AND ECOMCLI.ECKTNUMERO = LCOMCLI.LCKTNUMERO
AND LCCJDEREX > LCCJDEREX
AND ECCJCRE < LCCJDEREX
AND LCCTSOLACE = 'S'
AND LCCTNATURE <> '7'
) OR (
ECOMCLI.ECKTSOC = LCOMCLI.lcktsoc
AND ECOMCLI.ECKTNUMERO = LCOMCLI.LCKTNUMERO
AND ECCJCRE < LCCJDEREX
AND LCCTSOLACE <> 'S'
AND LCCTNATURE <> '7'
) OR (
ECOMCLI.ECKTSOC = LCOMCLI.lcktsoc
AND ECOMCLI.ECKTNUMERO = LCOMCLI.LCKTNUMERO
AND LCCTNATURE <> '7'
AND LCCTCODE = 'CL1414'
AND LCCTSOLACC <> 'S'
AND ECCJCRE < LCCJDEREX
) OR (
ECOMCLI.ECKTSOC = LCOMCLI.lcktsoc
AND ECOMCLI.ECKTNUMERO = LCOMCLI.LCKTNUMERO
AND LCCTNATURE <> '7'
AND LCCTCODE = 'CL1414'
AND LCCTSOLACC = 'S'
AND ECCJCRE < LCCJDEREX
AND LCCJDERCO > LCCJDEREX
) |
Partager