SQLTeam.com | Weblogs | Forums

SELECT with two Articlenumbers


#1

Hello,

i have a SELECT Query. Here is the Code:

SELECT a.Articlenumber, a.Description, zu.Articlenumber2
FROM Artikel a

INNER JOIN ZugeordneteArtikel zu
ON zu.Articlenumber2 = a.Articlenumber

WHERE a.Bezeichnung like '%(XXYY 2)'

This is all rights, but i need the Description from the Articlenumber2 which also in the Table Artikel. How can i show this after Articlenumber 2?

Thanks


#2
SELECT a.Articlenumber, a.Description, zu.Articlenumber2, 
    a_zu.Description AS Description2
FROM Artikel a

INNER JOIN ZugeordneteArtikel zu
ON zu.Articlenumber2 = a.Articlenumber
LEFT OUTER JOIN Artikel a_zu
ON a_zu.Articlenumber = zu.Articlenumber2

WHERE a.Bezeichnung like '%(XXYY 2)'