| 
	
 | 
 Posted by Guy on 02/19/06 13:00 
leupat a écrit : 
> Hello everybody !! 
>  
> I have a little problem with request. 
>  
> I have 2 tables like that : 
>  
> Table 1: T_Product 
> IdProduct 
> ProductName 
> IdSupplierPart1 
> IdSupplierPart2 
> IdSupplierPart3 
> ... 
> IdSupplier10 
>  
> Table 2: T_Supplier 
> IdSupplier 
> SupplierName 
> Adress 
> ... 
>  
> For one product we can have many supplier. 
>  
> How to received its name(ProductName) and names of each suppliers  
> (SupplierName) for 1 product into only 1 request ?? 
>  
> Thanks 
> Best regards. 
Bonjour, 
 
 
with union (but some limits ???) 
 
 
select ProductName, SupplierName from T_product,T_Supplier where  
IdSupplierPart1=IdSupplier 
union 
select ProductName, SupplierName from T_product,T_Supplier where  
IdSupplierPart2=IdSupplier 
union 
select ProductName, SupplierName from T_product,T_Supplier where  
IdSupplierPart3=IdSupplier 
... 
... 
... 
union 
select ProductName, SupplierName from T_product,T_Supplier where  
IdSupplierPart10=IdSupplier 
order by ProductName, SupplierName; 
 
GR
 
  
Navigation:
[Reply to this message] 
 |