SELECT cust.id,cust.name,status.name,rate.name,cust.phone,region.name,area.location,(select max(contactdate) from hqoa.t_hq_app_crm_cust_contact where customerid=cust.id ) as contactdate FROM hqoa.t_hq_app_crm_cust cust, hqoa.t_hq_app_crm_cust_type type, hqoa.t_hq_app_crm_cust_status status, hqoa.t_hq_app_crm_cust_rate rate, hqoa.t_hq_app_crm_cust_region region, hqoa.t_hq_app_crm_cust_area area WHERE type.id=cust.typeid and status.id=cust.statusid and rate.id=cust.rateid and region.id=cust.regionid and cust.city=area.no order by contactdate desc , cust.id desc
select (select name from t_hq_app_crm_cust_source where id=sourceid),count(sourceid) from t_hq_app_crm_cust group by sourceid
posted on 2008-07-03 16:14
xiaosilent 阅读(320)
评论(0) 编辑 收藏 所属分类:
Java OA