Thanks Peter and Ross for suggesting the correct solution. It works with
the following code:
SELECT apartner_nr, ap.anrede, ap.vorname, ap.nachname, k.name1,
ap.telefon, ap.fax, ap.email
FROM ansprechpartner ap, kunden k
WHERE ap.kunden_nr = k.kunden_nr
UNION
SELECT apartner_nr, ap.anrede, ap.vorname, ap.nachname, ag.name1,
ap.telefon, ap.fax, ap.email
FROM ansprechpartner ap, agenturen ag
WHERE ap.agentur_nr = ag.agentur_nr
ORDER BY nachname;
Best regards,
Anja
At 09:49 01.07.99 -0500, you wrote:
>Ah, now it's clear. You're looking for the UNION operator, and two selects.
>Something like:
>
>SELECT apartner_nr, ap.anrede, ap.vorname, ap.nachname, ap.telefon, ap.fax,
>ap.email, ap.kunden_nr, k.name1
>FROM ansprechpartner ap, kunden k
>WHERE ap.kunden_nr = k.kunden_nr
>UNION
>SELECT apartner_nr, ap.anrede, ap.vorname, ap.nachname, ap.telefon, ap.fax,
>ap.email, ap.agentur_nr, ag.name1
>FROM ansprechpartner ap, agenturen ag
>WHERE ap.agentur_nr = ag.agentur_nr
>ORDER BY nachname
_____________________________
>In this case you should try a union like
>SELECT ... FROM ap, k WHERE ap.kunden_nr = k.kunden_nr
>UNION
>SELECT ... FROM ap, ag WHERE ap.agentur_nr = ag.agentur_nr
>ORDER BY nachname;
>
>(Note the target lists.)