Hi,
we have a select statement that produces the following error
Base table or view already exists;-6000 POS(1) Duplicate table name
when it is executed a second time, a fourth time, a sixth time and soon.
SELECT Z.PERS_NR ,P.NNAME, P.VORNAME, S.SCHULNAME||', '||S.ORT AS SCHULE,
'Aus-bildung'
FROM (SELECT PZUAB.PERS_NR, MAX (DZUAB.ENDE) AS D_ENDE
FROM DBA.ST_ZUAB_LKR PZUAB, DBA.ST_ZUAB_DBV DZUAB
WHERE PZUAB.SCHULAMT_NR= 5
AND PZUAB.STICHTAG= '2005-8-1'
AND DZUAB.SCHULAMT_NR= 5
AND DZUAB.STICHTAG = '2005-8-1'
AND PZUAB.PERS_NR= DZUAB.PERS_NR
GROUP BY PZUAB.PERS_NR)Z, DBA.T_PERSSTAMM P, DBA.T_DBV D,
DBA.T_SCHULE S
WHERE Z.PERS_NR = P.PERS_NR
AND Z.PERS_NR=D.PERS_NR
AND D.SCHUL_ID = S.SCHUL_ID
AND D.ENDE= Z.D_ENDE
AND Z.PERS_NR NOT IN (SELECT PZUAB2.PERS_NR
FROM DBA.T_AUSBILDUNG, DBA.ST_ZUAB_LKR PZUAB2
WHERE PZUAB2.SCHULAMT_NR=5
AND PZUAB2.STICHTAG ='2005-8-1'
AND T_AUSBILDUNG.PERS_NR=PZUAB2.PERS_NR)
The cause maybe in the NOT IN (*).
If this SELECT is replaced by some concrete values, e.g. 5,6,7,8 no problem.
Elke
--
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]