SELECT 
g.id,
if(g2 is null,cast(g.id as CHAR),g2) as title,
f100, f101, f102a, f102b, f103a, f103b, f104a, f104b, f105a, f105b, f106,
concat_ws('|', if (f107a=1,1,null), if(f107b=1,2,null), if(f107c=1,3,null), if(f107d=1,4,null), if(f107e=1,5,null)) as f107ae,
f107f, f108,
concat_ws('|', if (f108a=1,1,null), if(f108b=1,2,null), if(f108c=1,3,null), if(f108d=1,4,null), if(f108e=1,5,null)) as f108ae,
f108f, f109, f109a, f109b, f109c, f109d, f109e, f109f, f110, f111, f112
 FROM genomos_fracture g, genomos_general gg where gg.id=g.id order by id
