PDA

View Full Version : crosstab


mfchan1
06-19-02, 00:53
Dear all,

I have a table[Category] like this:
Name | Category | total
Buchanan | Beverages | 400
Buchanan | Cnodiments | 500
Buchanan | Confections | 600
Callahan | Beverages | 700
Callahan | Condiments | 800
Callahan | Confections | 900

I would like to display it as follows:
Name | Beverages | Condiments | Confections
Buchanan | 400 | 500 | 600
Callahan | 700 | 800 | 900

What is the SQL statement to do the above selection? Thanks for your help.

Regards,
Fred

r937
06-19-02, 12:09
here's one way --
http://searchdatabase.techtarget.com/ateQuestionNResponse/0,289625,sid13_cid447321_tax285649,00.html

rudy
http://rudy.ca/