Dear Peter, thank you very much for this quick answer. Just to check if I understand well few more things.
1. Write a pivot query – Create query using, for example, PhpMyAdmin
2. View for that query – Create View it into PhpMyAdmin and than using that View as a source of data for WP Data Access
3. show your data – shortcode in post or page
Is this correct?