Anmelden

View Full Version : Frage an die SQL Profis



DKSPROFI
18-10-07, 08:27
Moin Kollegen,

wer kann mir helfen? Folgende SQL-Anweisung habe ich mir mit Hilfe des QM erstellt.

select A.KUNUM, A.KUABW, A.KUONM, B.ADNM1, C.KOONR,
D.OBJBZ, C.KOBBP, C.KOBBJ, C.KOBEP, C.KOBEJ, C.KOPRS
from LZDTAtst/GKUNSTP A, LZDTAtst/GADRSTP B, LZDTAtst/GKUOBZP C,
LZDTAtst/GOBJSTP D
WHERE (NOT(KUSTS = '9')
AND (KUABW = 0)
AND (((DIGITS(KOBEJ))!!(DIGITS(KOBEP))) = '000000')
AND (KOONR = 1020)
OR NOT(KUSTS = '9')
AND (KUABW >= 200742)
AND (((DIGITS(KOBEJ))!!(DIGITS(KOBEP))) >= (DIGITS(KUABW)))
AND (KOONR = 1020))
AND (KUNUM = ADNUM)
AND (ADNUM = KONUM)
AND (KOONR = OBJNR)
ORDER BY A.KUNUM

Funktioniert wunderbar. Aber ich habe meine Probleme mit der Sysntax. Nach diesem Muster bräuchte ich ein Update. Wenn alle Bedingungen erfüllt sind mach ein Update auf ein Feld Preis. Vielen Dank für Eure Mühe im voraus.

Fuerchau
18-10-07, 20:48
Grundsätzlich:

update myfile
set field=newval
where field2 in (select ....)
and field3 in (select ...)
and field4 = ...