str.append(" left join (
select customer_no,(case when auth_type=1 then count(route) when auth_type=2 then count(route) when auth_type=3 then count(route) end) as auth_image from h_auth_info where audit_sign=1) h6
");
select auth_info.customer_no,
(case when auth_info.auth_image=3 then 1
when auth_info.auth_image<3 then 0
end)
as auth_result
from(
select customer_no,
(case when auth_type=1 then count(route)
when auth_type=2 then count(route)
when auth_type=3 then count(route)
end)
as auth_image
from h_auth_info
where audit_sign=1 and customer_no='18632116655'
) auth_info
posted on 2014-12-26 09:14
藤本蔷薇 阅读(191)
评论(0) 编辑 收藏