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.

Abfrage über zwei Tabellen

Empfohlene Antworten

Veröffentlicht

Hallo zusammen

ich sollte eine Abfrage erstellen die mir die Auftragsnmmer und einen Stern in nur einer Zeile zurückgibt.

Ich habe eine Tabelle Auftrag und eine Tabelle Positionen. Jetzt muss ich eine Zeile pro Auftrag zurückerhalten mit der Auftragsnummer und in einer weiteren Spalte einen Stern, wenn in irgend einer Position des Auftrags eine Artikelnummer zwischen 2000 und 3000 vorkommt. Ich komme nicht dahinter. Mein Ansatz war folgender:

CREATE VIEW dbo.viAuftragFleisch

AS

SELECT AUF.AufNr, (CASE WHEN AUP.Artikel >= 5000 THEN '*' ELSE '-' END) AS Fleisch

FROM .Auftrag AUF

LEFT JOIN Auftragspos AUP ON AUF.AufNr = AUP.AufNr

Aber der gibt so viele Zeilen zurück wie es Positionen hat und Gruppieren kann ich nach der Funktion nicht. Was ist eine andere Lösung.

Danke für die Hilfe.

Hallo zusammen

die Lösung war ganz einfach. Hier mein Erguss:

CREATE VIEW dbo.viAuftragFleisch

AS

Select AufNr, '*' Fleisch From Auftrag

Where AufNr in (select AufNr from AuftragsPos Where Artikel between '5000' and '9000')

Ich Danke Euch für Eure Hilfe.

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.