select dhhm,
       (select jc from table1 where dm=table2.type1),
       (select jc from table1 where dm=table2.type2)
 from table2