SELECT DISTINCT ref_0.c_tk as c1, ref_0.c_epy6r_00o8 as c2, ref_0.c_tk as c3, ref_0.c_x49cz as c4, ref_0.c_qp as c5 FROM t_j as ref_0 UNION ALL (SELECT cast(1 as char) as c1, var_pop(cast(null as signed)) over (partition by ref_2.c_qbi13s order by ref_2.c_qbi13s, ref_2.c_a4f1v5d3q2, ref_2.c_yhcnkidi8, ref_2.c_qm, ref_2.c_h20voo1018, ref_2.c__w, ref_2.c_xxn6xl2q) as c2, ref_2.c__w as c3, ref_2.c_h20voo1018 as c4, ref_2.c_a4f1v5d3q2 as c5 FROM t_ufims7 as ref_2 ) ;