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.

Suche passende mySQL Abfrage

Empfohlene Antworten

Veröffentlicht

Servus,

Habe folgendes Problem bei einer mySQL Abfrage:

Zu den Tabelle, es gibt eine Tabelle mit Projekten (Inhalt: ID und Beschreibung), eine Tabelle mit Mitarbeitern (Inhalt:ID, Name etc.) und eine Tabelle in der ich die ID von Projekten und Mitarbeitern zusammenführe.

Nun will ich aber genau die Projekte ausgegeben bekommen, die einen Mitarbeiter gerade nicht zugewiesen wurden.

Hoffe jemand hat ne gute Idee.

Also bei folgender Struktur

+---------------+     +--------------------+     +------------+

| Mitarbeiter   |     | ProjektMitarbeiter |     | Projekt    |

+---------------+     +--------------------+     +------------+

| - id          |--+  | - id               |  +--| - id       |

| - name        |  +--| - mitarbeiter_id   |  |  | - title    |

| - ...         |     | - projekt_id       |--+  | - ...      |

+---------------+     +--------------------+     +------------+
lässt sich das ganze wohl am elegantesten mit einem Subselect lösen in der Form:
SELECT * FROM Projekt WHERE Projekt_Id NOT IN (SELECT Projekt_Id FROM ProjektMitarbeiter WHERE Mitarbeiter_Id = 42)

lässt sich das ganze wohl am elegantesten mit einem Subselect lösen in der Form:

Nun ja, ob man Subselects elegand findet ist geschmackssache, ich würde das über einen LEFT JOIN machen. ;)

Gruß Jaraz

Danke klappt wunderbar!

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.