Can anyone help with this db2 query that I have to rewrite for mysql since it doesn't support subselects and interprets EXISTS differently please? By the way, anyone know when mysql4.1 binaries will be
available?????
--------------------------
INSERT INTO NAMEX_M
SELECT
'493N', NAME_LAST, NAME_FIRST, NAME_MI , SSN, '0'
, 'CNVTD', 'CNVTD', DATE_SYSTEM
, NAME_SUFX
FROM HNAME_X A
WHERE
NAME <> 'COMMENTS CNVTD'
AND
NOT EXISTS (
SELECT 1 FROM NAMEX_M B
WHERE A.SSN = B.SSN
AND A.NAME_LAST = B.NAME_LAST
AND A.NAME_FIRST = B.NAME_FIRST
AND A.NAME_MI = B.NAME_MI
AND A.NAME_SUFX = B.NAME_SUFFIX
)
AND A.DATE_SYSTEM = (SELECT
MAX(DATE_SYSTEM) FROM HNAME_X C
WHERE A.SSN = C.SSN
)
available?????
--------------------------
INSERT INTO NAMEX_M
SELECT
'493N', NAME_LAST, NAME_FIRST, NAME_MI , SSN, '0'
, 'CNVTD', 'CNVTD', DATE_SYSTEM
, NAME_SUFX
FROM HNAME_X A
WHERE
NAME <> 'COMMENTS CNVTD'
AND
NOT EXISTS (
SELECT 1 FROM NAMEX_M B
WHERE A.SSN = B.SSN
AND A.NAME_LAST = B.NAME_LAST
AND A.NAME_FIRST = B.NAME_FIRST
AND A.NAME_MI = B.NAME_MI
AND A.NAME_SUFX = B.NAME_SUFFIX
)
AND A.DATE_SYSTEM = (SELECT
MAX(DATE_SYSTEM) FROM HNAME_X C
WHERE A.SSN = C.SSN
)