Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

SQL: Tabllenfeld in mehrere Ergebniszeilen aufsplitten

Empfohlene Antworten

Veröffentlicht

Hi Leute,

folgendes Problem:

In einer mySQL-Datenbanktabelle gibt es (vereinfacht) zwei Felder, ein Varchar-Feld und ein Set.

Nun möchte ich für jedes Element im SET eine Ergebniszeile im Ergebnis der SELECT-Abfrage aller Daten haben...

Beispiel: Test - 1,2,3,4

Jetzt soll das Ergebnis so aussehen:

Test - 1

Test - 2

Test - 3

Test - 4

Ist das irgendwie allein mit mySQL machbar? Vielleicht mit den Flusssteuerfeatures LOOP, ITERATE?

Edit: Achja, normalisiert, oder nicht spielt jetzt mal keine Rolle ;)

Danke.

- Monty

group by vielleicht ?

select * from tabelle where name=test group by name limit 1;

Mit MSSQL würde ich einen Trigger aufmachen, eine temporäre Tabelle erstellen, inserten und jene Tabelle ausgeben.

Ist die Anzahl (1,2,3,4) Variabel? Dann musst du es so machen.

Weiß jetzt leider bloß nicht, wie sowas in MySQL möglich ist, oder ob überhaupt.

ich würde mal ganz einfach sagen, das ist sache der Anwendung, nicht der Datenbank. Rumformattiererei seitens SQL ist bäh *g* (meine Meinung)....

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.