MS Access - Werte in mehreren Spalten zusammenfügen
Hallo Leute,
ich habe eine Access-Tabelle in der es (unter anderem) folgende Spalten gibt:
| Datum| Lieferant | Preis 1 | Preis 2 | Preis 3 | Preis 4 | Preis 5|
Ich möchte gerne eine Abfrage erstellen, in der alle Preise in einer Spalte aufgeführt werden:
| Datum| Lieferant | Preis 1 |
| Datum| Lieferant | Preis 2 |
| Datum| Lieferant | Preis 3 |
| Datum| Lieferant | Preis 4 |
| Datum| Lieferant | Preis 5 |
Wie kann das umgesetzt werden?
Gruß
Thorwald
ich habe eine Access-Tabelle in der es (unter anderem) folgende Spalten gibt:
| Datum| Lieferant | Preis 1 | Preis 2 | Preis 3 | Preis 4 | Preis 5|
Ich möchte gerne eine Abfrage erstellen, in der alle Preise in einer Spalte aufgeführt werden:
| Datum| Lieferant | Preis 1 |
| Datum| Lieferant | Preis 2 |
| Datum| Lieferant | Preis 3 |
| Datum| Lieferant | Preis 4 |
| Datum| Lieferant | Preis 5 |
Wie kann das umgesetzt werden?
Gruß
Thorwald
Please also mark the comments that contributed to the solution of the article
Content-Key: 11169092825
Url: https://administrator.de/contentid/11169092825
Printed on: May 11, 2024 at 09:05 o'clock
3 Comments
Latest comment
Moin,
im schlimmsten Fall:
im schlimmsten Fall:
SELECT datum, lieferant, "Preis 1" AS preis WHERE "Preis 1" IS NOT null
UNION ALL
SELECT datum, lieferant, "Preis 2" AS preis WHERE "Preis 2" IS NOT null
UNION ALL
SELECT datum, lieferant, "Preis 3" AS preis WHERE "Preis 3" IS NOT null
UNION ALL
SELECT datum, lieferant, "Preis 4" AS preis WHERE "Preis 4" IS NOT null
UNION ALL
SELECT datum, lieferant, "Preis 5" AS preis WHERE "Preis 5" IS NOT null
Oder UNPIVOT aber da Access ist die Lösung die selbe
https://stackoverflow.com/questions/7255423/how-to-simulate-unpivot-in-a ...
https://stackoverflow.com/questions/7255423/how-to-simulate-unpivot-in-a ...