Hallo
SQL-Spezis,
kann ich das noch vereinfachen?
SQL-Code:
select
t.*,
uc.Name as CreateUserName,
um.Name as ModifyUserName,
uo.Name as OwnerName
from tags t, User uc, User um, User uo
where
((t.OwnerID is NULL) or (t.OwnerID = :User))
AND (t.CreateUserID = uc.ID)
AND (t.ModifyUserID = um.ID)
AND (t.OwnerID = uo.ID)
order by t.Name;
Es geht um die Tabelle User mit den drei Aliasen.
Gruß Andreas