create temp table tempselections as
select
	distinct on
	(ts.selectionid) ts.selectionid
from
	iszl.t_disp_direct_link as tddl
join iszl.t_selection as ts on
	tddl.Selection = ts.selectionid;

update
	ISZL.T_SELECTION as selection
set
	MO = (
	select
		dd.MO
	from
		ISZL.T_SELECTION s
	join ISZL.T_DISP_DIRECT_LINK ddl on
		ddl.Selection = s.SelectionID
	join ISZL.T_DISP_DIRECT dd on
		dd.DispDirectID = ddl.DispDirect
	where
		dd.Mo is not null
		and s.SelectionID = selection.SelectionID
	limit 1)
where
	selection.MO is null
	and selection.SelectionID in (
	select
		*
	from
		tempselections);
    
drop table tempselections;