23.7. Cross Tabulations

A cross tabulation, or crosstab for short, is a common statistical report. It can be done in IBM’s QMF tool, using the ACROSS summary option, and in many other SQL-based reporting packages. SPSS, SAS, and other statistical packages have library procedures or language constructs for crosstabs. Many spreadsheets can load the results of SQL queries and perform a crosstab within the spreadsheet.

If you can use a reporting package on the server in a client/server system instead of the following method, do so. It will run faster and in less space than the method discussed here.

However, if you have to use the reporting package on the client side, the extra time required to transfer data will make these methods on the server ...

Get Joe Celko's SQL for Smarties, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.