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.

Nicht zugewiesene Rollen finden.

Empfohlene Antworten

Veröffentlicht

Hi,

ich habe eine n:m Beziehung zwischen Person und Role über eine Tabelle Member abgebildet.

Wie kann ich nun alle Rollen ausgeben, zu der eine Person NICHT einen Eintrag in der Member Tabelle hat?

Ich hatte da outer join im Hinterkopf, aber irgendwie will postgresql nicht.

Tabllen:


create table PERSON (

   PERSON_ID int8 not null,

   name varchar(255),

   primary key (PERSON_ID)

);

create table MEMBER (

   MEMBER_ID int8 not null,

   PERSON_ID int8 not null,

   ROLE_ID int8 not null,

   primary key (MEMBER_ID)

);

create table ROLE (

   ROLE_ID int8 not null,

   name varchar(255),

   primary key (ROLE_ID)

);

Gruß Jaraz

Geht das nicht auch so ohne JOIN? Weiß nicht, ob Deine DB das kann.

SELECT name AS ROLE

FROM ROLE

WHERE ROLE_ID NOT IN

(SELECT ROLE_ID

FROM MEMBER

WHERE MEMBER_ID = xxx)

Hi,

das kommt davon, dass man zu lange mit alten Mysql Versionen arbeitet, dann verdrängt man subselects komplett. ;)

Aber auf Postgresql funktioniert das. Danke!

Gruß Jaraz

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.