Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
List of suppliers
Message
 
To
14/01/2008 07:14:09
Issam Mansour
Jordan Business Machines
Amman, Jordan
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
01281526
Message ID:
01281535
Views:
6
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform