mysql 高级用法

update SYS_COMPANY_RESOURCE set orgResource_id=(select topid from(select distinct t2.id as id,t2.name,t1.orgResource_id,mid(t3.value,15,6) as topid from
SYS_COMPANY_RESOURCE t1 join   ENT_COMPANY  t2
on(t1.company_id=t2.id)
join  SYS_DICTIONARY t3 
on (t2.type=t3.id) 
where t3.id not in('e3e93e9bb0c84fbebf0429206ee0c154','f47668c559de49dea802d4f49464dee6','f9e3fa7a72974ed4a579cebf5f79457d')
and (locate('101',orgResource_id)=0 and locate('102',orgResource_id)=0)) t4 where  t4.id=company_id )
where (locate('101',orgResource_id)=0 and locate('102',orgResource_id)=0)

猜你喜欢

转载自wddpwzzhao123.iteye.com/blog/2177674
今日推荐