RHNPRIVATEERRATAMAIL
DDL scriptColumns
| Name | Type | Nullable | Insertable | Updatable | Deletable | Comment |
|---|
| USER_ID | NUMBER(38) | N | NO | NO | NO | |
| SERVER_ID | NUMBER(38) | N | NO | NO | NO | |
| ORG_ID | NUMBER(38) | N | NO | NO | NO | |
| CHANNEL_ID | NUMBER(38) | N | NO | NO | NO | |
| ERRATA_ID | NUMBER(38) | N | NO | NO | NO | |
Query:
Legend: string keyword reserved word operator
select
w.id user_id,
s.id server_id,
w.org_id org_id,
sc.channel_id channel_id,
ce.errata_id errata_id
from
rhnServer s,
web_user_personal_info wpi,
rhnUserInfo ui,
rhnChannelErrata ce,
web_contact w,
rhnServerChannel sc,
rhnUserServerPerms usp
where
sc.channel_id = ce.channel_id
and sc.server_id = s.id
and w.id = wpi.web_user_id
and wpi.email is not null
and w.id = ui.user_id
and s.id = usp.server_id
and usp.user_id = w.id
and not exists (
select usprefs.server_id
from rhnUserServerPrefs usprefs
where w.id = usprefs.user_id
and sc.server_id = usprefs.server_id
and usprefs.name = 'receive_notifications'
)
and ui.email_notify = 1
and exists (
select 1
from
rhnPackageEVR p_evr,
rhnPackageEVR sp_evr,
rhnServerPackage sp,
rhnChannelPackage cp,
rhnPackage p,
rhnErrataPackage ep,
rhnServerPackageArchCompat spac
where 1=1
and sc.channel_id = cp.channel_id
and cp.package_id = p.id
and ce.errata_id = ep.errata_id
and ep.package_id = p.id
and sc.channel_id = ce.channel_id
and ce.errata_id = ep.errata_id
and sc.server_id = sp.server_id
and sp.name_id = p.name_id
and sp.evr_id = sp_evr.id
and p.evr_id = p_evr.id
and sp.evr_id != p.evr_id
and sp_evr.evr < p_evr.evr
and sp_evr.evr = (
select max(sq2_pe.evr) max_evr
from rhnServerPackage sq2_sp,
rhnPackageEVR sq2_pe
where sq2_sp.evr_id = sq2_pe.id and
sq2_sp.server_id = sp.server_id and
sp.name_id = sq2_sp.name_id
group by sq2_sp.server_id, sq2_sp.name_id
)
and p.package_arch_id = spac.package_arch_id
and s.server_arch_id = spac.server_arch_id
)
and not exists ( select 1
from rhnWebContactDisabled wcd
where wcd.id = w.id )