Hello Tagoso,
try this query
Code:
select x.name,
x.r_un_start,
x.r_un_end,
( SELECT lk1 FROM mytable m
WHERE m.`desc` = x.`desc` AND m.r_u_start = x.r_un_start
LIMIT 1
) lk1,
( SELECT lk2 FROM mytable m
WHERE m.`desc` = x.`desc` AND m.r_un_end = x.r_un_end
LIMIT 1
) lk2,
x.`desc`
FROM (
SELECT name, `desc`, min( run_start) run_start, max(run_end) run_end
FROM mytable
GROUP BY `desc`
) x;
It is strange - this forum replaces .strings: . r u (dot+r+u) with ****,
so in the query i used .r_un instead of . r u n