Wie simulieren UNPIVOT in Access?

UNPIVOT ist verfügbar in MS SQL-Server 2005, aber AFAIK nicht in MS Access 2010. Wie kann es implementiert werden, mit on-board-Mittel? Ich habe zum Beispiel eine Tabelle

ID | A | B | C | Key 1 | Key 2 | Key 3
---------------------------------------
 1 | x | y | z |     3 |   199 |   452
 2 | x | y | z |    57 |   234 |   452

wollen und einen Tisch haben, wie

ID | A | B | C | Key
--------------------
 1 | x | y | z |   3
 2 | x | y | z |  57
 1 | x | y | z | 199
 2 | x | y | z | 234
 2 | x | y | z | 452

Schlüssel 452 ist ein besonderer Fall. Derzeit mache ich die rotation in OLEDB/ATL C++. Es ist zwar schnell genug, ich bin immer noch neugierig. Was ist das effizienteste SQL-Anweisung für Access 2010 hier?

Schreibe einen Kommentar