|  | 
| select count(userid) from order where ifsend = 1
 and substr(sendid,1,2) = 'EC'
 and asst_id in (904,4553,4874)
 and userid in (select userid from order
 where ifsend = 1 and asst_id = 0 and substr(sendid,1,2) not in ('EQ','TB','EP'));
 ===================================
 在sendid上建索引,然后将substr(sendid,1,2)='EC'改成sendid like 'EC%'应该会更好些。
 | 
 |