Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
List of suppliers
Message
 
À
14/01/2008 07:14:09
Issam Mansour
Jordan Business Machines
Amman, Jordanie
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01281526
Message ID:
01281535
Vues:
7
>No. Coverted to VFP table, Any way.
>
>The table have the following headers
>
>ItemNo
>Supp1 No
>supp2 no
>supp3 No
>.
>.
>Supp10 No
>
>The Supplier item list I Need as follows:
>
>supplier 1
>item1
>Item2
>.
>.
>
>
>supplier 2
>item3
>item11
>
>Thanks for your help

Try:
SELECT Supp1 AS Supplier,
       Item
FROM YourTable
WHERE ISNULL(Supp1,0) <> 0
UNION ALL
SELECT Supp2 AS Supplier,
       Item
FROM YourTable
WHERE ISNULL(Supp2,0) <> 0
UNION ALL
...
UNION ALL
SELECT Supp10 AS Supplier,
       Item
FROM YourTable
WHERE ISNULL(Supp10,0) <> 0
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform