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.

Empfohlene Antworten

Veröffentlicht

Hallo,

es gibt folgendes Problem in einer ORACLE-Datenbank:

Es soll der Abflugtag, die Flugbezeichnung und der Hersteller bestimmt werden, der der letzte von Paris nach London im Zeitraum 14.02.2009 - 19.02.2009 ist.

Dazu steht die Tabelle start mit den Attributen FLUG_B (CHAR), ABFLUG (DATE) und HERST (CHAR) zur Verfügung:

FLUG_B ABFLUG HERST

LH-358 13.02.09 Boing

LH-421 15.02.09 Boing

LH-789 17.02.09 Airbus

LH-112 14.02.09 Boing

LH-421 17.02.09 Boing

LH-223 18.02.09 Airbus

Ausserdem gibt es die Tabelle flug mit den Attributen FLUG_B (CHAR), START (CHAR) und ZIEL (CHAR).

FLUG_B START ZIEL

LH-358 Bremen Leipzig

LH-112 Luxemburg London

LH-421 Paris London

LH-789 Luxemburg New-York

LH-223 Frankfurt Dallas

Meine Idee war dann Folgende:

SELECT MAX (s.abflug) "ABFLUG", s.flug_b, s.herst

FROM start s, flug f

WHERE s.flug_b = f.flug_b

AND

s.abflug BETWEEN '14.02.2009' AND '19.02.2009'

AND

f.sart = 'Paris' AND f.ziel = 'London'

GROUP BY s.flug_b, s.herst;

Das Ergebnis der Abfrage sieht dann leider folgendermaßen aus:

ABFLUG FLUG_B HERST

15.02.09 LH-421 Boing

17.02.09 LH-421 Boing

Wie erhalte ich das richtige Ergebnis (17.02.09, LH-421, Boing)?

Ist die Lösung evtl. über eine Unterabfrage zu erhalten?

Vielen Dank für die Hilfe im Voraus.

Nach der geposteten Aufgabe und wenn insbesondere die Uhrzeiten nicht bekannt sind, ist das Ergebnis doch nicht zwingend eindeutig, nämlich dann nicht wenn am gleichen Tag 2 oder mehr Flüge von A nach B gehen.

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

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.