Hi.

On Mon, Oct 01, 2001 at 10:04:50AM +0200, [EMAIL PROTECTED] wrote:
> 
> how can i link three tables with joins on one table?
> 
> Select
> b.IdentNrA,b.Menge,b.Preis,b.ArtPosition,c.Artikel_Status,d.beschTitel,e.Str
> asse,e.PLZ,e.Stadt,e.Land
> From
> Bestellungen_Status_Text f right join (BestellungenAdr e inner join
> Bestellungen a using(IdentNrS)) using (BestellStatus) inner join
> BestellungenP b using (IdentNrS) inner join artikel c using (IdentNrA) inner
> join ArtikelText d using (IdentNrA)
> Where
> b.IdentNrS = 22 and
> d.Sprache = 'DE'
> Order By b.ArtPosition
> 
> does not work.

"doesn not work" isn't very descriptive. Do you get an error message?
If so, which?

I assume the problem is that you are trying to bracket the table
references, which for I cannot see any syntax reference on
http://www.mysql.com/doc/J/O/JOIN.html.

You can easily rewrite the query to avoid the brackets by using a left
join instead of a right join:

SELECT     b.IdentNrA, b.Menge, b.Preis, b.ArtPosition,
           c.Artikel_Status,
           d.beschTitel,
           e.Strasse, e.PLZ, e.Stadt, e.Land
FROM       BestellungenAdr e
           INNER JOIN Bestellungen a USING(IdentNrS)
           LEFT JOIN Bestellungen_Status_Text f USING (BestellStatus)
           INNER JOIN BestellungenP b USING (IdentNrS)
           INNER JOIN artikel c USING (IdentNrA)
           INNER JOIN ArtikelText d USING (IdentNrA)
WHERE      b.IdentNrS = 22 AND
           d.Sprache = 'DE'
ORDER BY   b.ArtPosition


Bye,

        Benjamin.

-- 
[EMAIL PROTECTED]

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to