我写了一条SQL查询语句,如下:
select A.* from t8030_plant_real_data A ,(select plant,link_unit from t8042_lable_plant where lower(LABLE) = 'lb_pjz' ) B
where A.plant=B.plant and A.LINK_UNIT=B.LINK_UNIT
and A.M_TYPE= 'plant'
and TO_CHAR(A.M_TIME ,'YYYY-MM-DD') = '2007-01-01'