I have a table and want to transpose its rows to columns, similar to a pivot table but without summarising.
For example I have the following tables:
Do your grouping and aggregating first, using Quassnoi's answer as an intermediate result.
Crosstabulation should only be done when you are no longer going to be doing set oriented operatons on the results. Some SQL dialects have keywords like PIVOT, TRANSFORM or CROSSTABULATE to accomplish this, but you're probably better off using XSLT.