Databases Reference
In-Depth Information
and sb2.line_No = 2
and sb3.line_No = 3
and sb4.line_No = 4
Der komplette Select sieht wie folgt aus:
Select distinct sb1.orderNo,
sb1.[description]Artikel_1,sb1.colorDescription Color_1,
sb1.size Size_1, sb1.productGroup Group_1,
sb2.[description]Artikel_2,sb2.colorDescription Color_2,
sb2.size Size_2, sb2.productGroup Group_2,
sb3.[description]Artikel_3,sb3.colorDescription Color_3,
sb3.size Size_3, sb3.productGroup Group_3,
sb4.[description]Artikel_4,sb4.colorDescription Color_4,
sb4.size Size_4, sb4.productGroup Group_4
from
(SELECT s.[line_No], s.[orderNo], a.article_No, a.[description],
a.colorDescription, a.size, a.productGroup
FROM [dbo].[iw_sales]s,[dbo].[iw_article]a
where s.[type] = 2
and s.orderDate between '01.05.2011'and '31.05.2011'
and s.IWAN = a.IWAN)sb1,
(SELECT s.[line_No], s.[orderNo], a.article_No, a.[description],
a.colorDescription, a.size, a.productGroup
FROM [dbo].[iw_sales]s,[dbo].[iw_article]a
where s.[type] = 2
and s.orderDate between '01.05.2011'and '31.05.2011'
and s.IWAN = a.IWAN)sb2,
(SELECT s.[line_No], s.[orderNo], a.article_No, a.[description],
a.colorDescription, a.size, a.productGroup
FROM [dbo].[iw_sales]s,[dbo].[iw_article]a
where s.[type] = 2
and s.orderDate between '01.05.2011'and '31.05.2011'
and s.IWAN = a.IWAN)sb3,
(SELECT s.[line_No], s.[orderNo], a.article_No, a.[description],
a.colorDescription, a.size, a.productGroup
FROM [dbo].[iw_sales]s,[dbo].[iw_article]a
where s.[type] = 2
and s.orderDate between '01.05.2011'and '31.05.2011'
and s.IWAN = a.IWAN)sb4
where sb1.orderNo = sb2.orderNo
and sb1.orderNo= sb3.orderNo
and sb1.orderNo= sb4.orderNo
and sb1.line_No = 1
and sb2.line_No = 2
and sb3.line_No = 3
and sb4.line_No = 4
Führen Sie den Select aus und schauen Sie sich die Warenkörbe an (Bild 29.1). Fällt Ihnen
etwas auf? Alle Warenkörbe beinhalten vier Artikel. Warenkörbe, die weniger als vier Arti-
kel enthalten, sind in der Ergebnistabelle nicht aufgeführt.
 
Search WWH ::




Custom Search