select * from
cw_driver_assign as d
left join
cw_order as o on
d.orderId = o.id where d.driverId=1
and d.bespeakDate>='2015-11-11'
and d.bespeakDate<='2015-11-11'
and o.driverState<>23
and o.driverState <> 238
cw_driver_assign as d
left join
cw_order as o on
d.orderId = o.id where d.driverId=1
and d.bespeakDate>='2015-11-11'
and d.bespeakDate<='2015-11-11'
and o.driverState<>23
and o.driverState <> 238