标题: 虎绿林管理SQL:查询已有发言但access=0的用户并将access置为1
时间: 2024-03-19发布,2024-03-19修改
select uid,name from hu60_user where access=0
and
(
  ((select count(*) from hu60_bbs_topic_content where uid=hu60_user.uid) > 0)
  or
  ((select count(*) from hu60_addin_chat_data where uid=hu60_user.uid) > 0)
)
select uid,content from hu60_bbs_topic_content where uid in
(
  select uid from hu60_user where access=0
  and
  (
    ((select count(*) from hu60_bbs_topic_content where uid=hu60_user.uid) > 0)
    or
    ((select count(*) from hu60_addin_chat_data where uid=hu60_user.uid) > 0)
  )
)
select uid,content from hu60_addin_chat_data where uid in
(
  select uid from hu60_user where access=0
  and
  (
    ((select count(*) from hu60_bbs_topic_content where uid=hu60_user.uid) > 0)
    or
    ((select count(*) from hu60_addin_chat_data where uid=hu60_user.uid) > 0)
  )
)
update hu60_user set access=1 where access=0
and
(
  ((select count(*) from hu60_bbs_topic_content where uid=hu60_user.uid) > 0)
  or
  ((select count(*) from hu60_addin_chat_data where uid=hu60_user.uid) > 0)
)
『回复列表(1|隐藏机器人聊天)』