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 Abfrage aus zwei Tabellen

Empfohlene Antworten

Veröffentlicht

Hallöchen,

mach gerad ein kleines Tippspiel und da hab ich zwei Tabellen. In

der einen stehen die Spiele mit dazugehörigem Spieltag und in

die andere kommen die Tipps mit Namen des Tippers und Spieltag

usw.

Wenn man jetzt einen neuen Tipp abgeben möchte, sollen aber

nur die Spieltage angezeigt werden die der Tipper noch nicht getippt hat.

Hier mein Ansatz:


SELECT * FROM  tips tp, blspiele sp where tp.spieltag <> sp.spieltag and tp.name = 'name'

Das liefert aber nicht den gewünschten Erfolg. Wer weiß Rat?

Hi,

kann es sein, das Du das meinst?

SELECT tp.spieltag FROM tips tp, blspiele sp where tp.spieltag <> sp.spieltag and tp.name = 'name'

Nein, so nicht.

Also hab 4 verschiedene Spieltage in der blspiele tabelle und ein user hat davon zwei getippt, d.h. zwei Einträge in der tips Tabelle. Als Ergebniss sollen jetzt also die Spieltage aus der blspiele Tabelle rauskommen, die er noch nicht getippt hat.

Das wärs gewesen


SELECT * 

FROM blspiele LEFT JOIN tips 

ON blspiele.spieltag=tips.tipspieltag AND tips.name='$name'

WHERE tips.tipspieltag IS  NULL

Gruss Vietzer

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.