Hi,
maybe I'm simply to dump but I could not transform this SQL-Statment
which uses a Sub-select and create on that uses an OUTER JOIN.
--------------------------8<--------------------------
SELECT
p_id,
CONCAT( " hist. ", CONCAT( UPPER(p_surname), CONCAT( ',',
p_givenname ) ) )
FROM
persons p,
employee_contracts e
WHERE
p.delmark = 0
AND e.delmark = 0
AND e.ec_fk_person = p.p_id
AND p_is_employee = 1
AND e.ec_end_date <= NOW()
AND p_id NOT IN
(
SELECT DISTINCT
p_id
FROM
persons p,
employee_contracts e
WHERE
p.delmark = 0
AND e.delmark = 0
AND e.ec_fk_person = p.p_id
AND p_is_employee = 1
AND ( e.ec_end_date >= NOW() OR e.ec_end_date IS NULL )
)
--------------------------8<--------------------------
Thanks for your help. I cannot switch to mysql-4.1 and that's why I need
this working without sub-selects.
Tom