select count(*)
from(
select 转供户ID from df_yonghudangan where ID in (select 用户ID from df_dianfei_bd where 用电性质='农村居民') group by 转供户ID)a--或:
select count(distinct 转供户ID) from df_yonghudangan where ID in (select 用户ID from df_dianfei_bd where 用电性质='农村居民')
from(
select 转供户ID from df_yonghudangan where ID in (select 用户ID from df_dianfei_bd where 用电性质='农村居民') group by 转供户ID)a--或:
select count(distinct 转供户ID) from df_yonghudangan where ID in (select 用户ID from df_dianfei_bd where 用电性质='农村居民')
from(
select 转供户ID from df_yonghudangan where ID in (select 用户ID from df_dianfei_bd where 用电性质='农村居民') group by 转供户ID)a--或:
select count(distinct 转供户ID) from df_yonghudangan where ID in (select 用户ID from df_dianfei_bd where 用电性质='农村居民')
from(
select 转供户ID from df_yonghudangan where ID in (select 用户ID from df_dianfei_bd where 用电性质='农村居民') group by 转供户ID)a
from(
select 转供户ID from df_yonghudangan where ID in (select 用户ID from df_dianfei_bd where 用电性质='农村居民') group by 转供户ID)a--或:
select count(distinct 转供户ID) from df_yonghudangan where ID in (select 用户ID from df_dianfei_bd where 用电性质='农村居民')