Wie alias Sie eine Tabelle während Sie die gleiche Tabelle von sich selbst aktualisieren?Wie alias eine Tabelle während der Aktualisierung der gleichen Tabelle von sich selbst?
Meine Suche:
update accounts set adusername = x.adusername
from Accounts x
where x.AccountName = accounts.rev and x.ok>10 and accounts.ok in (0,1,2,3)
and x.ADUserName is not null and accounts.ADUserName is null
Fehler
Msg 4104, Level 16, State 1, Line 9
The multi-part identifier "accounts.rev" could not be bound.
Msg 4104, Level 16, State 1, Line 9
The multi-part identifier "accounts.ok" could not be bound.
Msg 4104, Level 16, State 1, Line 9
The multi-part identifier "accounts.ok" could not be bound.
Msg 4104, Level 16, State 1, Line 9
The multi-part identifier "accounts.ok" could not be bound.
Msg 4104, Level 16, State 1, Line 9
The multi-part identifier "accounts.ok" could not be bound.
Msg 4104, Level 16, State 1, Line 9
The multi-part identifier "accounts.ADUserName" could not be bound.
Bitte einige Beispieldaten angeben. – Wanderer
@Ullas, das ist die eigentliche Abfrage, mit der ich arbeite –