外部权限表筛选数据问题

select distinct org.base_name,org.factory_stage

from zh_ads.ads_zzqlc_produce_detail org,

zh_ods.ods_fr_calb_export_user_data_permission p

where  p.user_name= '123'

and if(p.base_name is NULL,1=1,p.base_name in ('select distinct org.base_name from zh_ads.ads_zzqlc_produce_detail where p.user_name= '123'')) 为什么会报错

image.png 

FineReport 帆软用户YbG5J0kkjo 发布于 2023-3-29 16:45
1min目标场景问卷 立即参与
回答问题
悬赏:3 F币 + 添加悬赏
提示:增加悬赏、完善问题、追问等操作,可使您的问题被置顶,并向所有关注者发送通知
共1回答
最佳回答
0
snrtuemcLv8专家互助
发布于2023-3-29 16:46

select distinct org.base_name,org.factory_stage

from zh_ads.ads_zzqlc_produce_detail org,

zh_ods.ods_fr_calb_export_user_data_permission p

where  p.user_name= '123'

and if(p.base_name is NULL,1=1,p.base_name in (select distinct org.base_name from zh_ads.ads_zzqlc_produce_detail where p.user_name= '123'))

正常最后in里面的是不需要引号的

  • 1关注人数
  • 266浏览人数
  • 最后回答于:2023-3-29 16:46
    请选择关闭问题的原因
    确定 取消
    返回顶部