日期:2014-05-17 浏览次数:20824 次
SELECT te_vehicletarget.reg_date,te_vehicletarget.open_date,te_vehicletarget.close_date, tr_tmn_vehicle.bindtime FROM ttr_tmn_vehicle,te_terminal,e_vehicletarget where tr_tmn_vehicle.SU_MDN = ' ' AND te_vehicletarget.ID = tr_tmn_vehicle.VHC_ID AND te_terminal.ID = tr_tmn_vehicle.TMn_ID
------解决方案--------------------
te_vehicletarget m条
tr_tmn_vehicle n条
te_terminal p条
做连接m*n*p条,
where条件,就是将这m*n*p条数据中的每条数据进行过滤,符合的留下,不符合的过滤……
------解决方案--------------------
select a.te_vehicletarget.reg_date,a.te_vehicletarget.open_date,a.te_vehicletarget.close_date,b.tr_tmn_vehicle.bindtime
from
te_vehicletarget a,tr_tmn_vehicle b,te_terminal c
where
a.te_vehicletarget.ID = b.tr_tmn_vehicle.VHC_ID
and
a.te_terminal.ID = b.tr_tmn_vehicle.TMn_ID
and
b.tr_tmn_vehicle.SU_MDN = ''