当前位置: 首页 > news >正文

网站运营与推广论文百度指数查询官网入口

网站运营与推广论文,百度指数查询官网入口,揭阳中小企业网站制作,哪个网站的课件做的好处文章目录 问题描述先看结果表结构展示实现递归查询集合查询结果修复数据 问题描述 最近开发过程中遇到一个问题,每次添加代理关系都要去递归查询一下它在不在这个代理关系树上.很麻烦也很浪费资源.想着把代理关系的父类全部存起来 先看结果 表结构展示 表名(t_agent_user_rela…

文章目录

  • 问题描述
    • 先看结果
    • 表结构展示
    • 实现递归查询集合
    • 查询结果
    • 修复数据

问题描述

最近开发过程中遇到一个问题,每次添加代理关系都要去递归查询一下它在不在这个代理关系树上.很麻烦也很浪费资源.想着把代理关系的父类全部存起来

先看结果

在这里插入图片描述

表结构展示

表名(t_agent_user_relation)
字段名字段类型描述
current_user_idint当前用户id
superior_user_idint代理用户id
parent_idsvarchar父类Id集合以逗号隔开
parent_idint父类ID
idint主键

实现递归查询集合

因为没有对应函数,需要自行编写递归查询函数

createdefiner = root@`%` function getParentIds(child_id int) returns varchar(255)
BEGINDECLARE parent_id varchar(255) default '';DECLARE parent_ids VARCHAR(1500) default '';DECLARE count int;DECLARE sum int default 0;-- 获取当前子类的父类IDSELECT superior_user_id INTO parent_id FROM t_agent_user_relation WHERE current_user_id = child_id;-- 递归查询所有父类IDWHILE parent_id is not null && sum < 3DOSET parent_ids = CONCAT_WS(',', parent_ids, parent_id);SELECT count(1) into count FROM t_agent_user_relation WHERE current_user_id = parent_id;if count = 0 thenset parent_id = null;elseSELECT superior_user_id INTO parent_id FROM t_agent_user_relation WHERE current_user_id = parent_id;end if;-- 防止出现死循环if parent_id is not null && find_in_set(parent_id, parent_ids) > 0thenset sum = sum + 1;elseset sum = sum;end if;END WHILE;RETURN parent_ids;
END;

如果出现以下错误
[HY000][1418] This function has none of DETERMINISTIC, NO SQL, or READS SQL

执行set global log_bin_trust_function_creators = 1; 错误原因我就不在这里分析了,有兴趣的自己查询一下

查询结果

select  current_user_id,superior_user_id,getParentIds(current_user_id) from t_agent_user_relation

在这里插入图片描述

修复数据

update t_agent_user_relation set    parent_ids=  getParentIds(current_user_id)  where parent_ids is null

文章转载自:
http://assuming.zfqr.cn
http://asclepiad.zfqr.cn
http://pickel.zfqr.cn
http://ninefold.zfqr.cn
http://discardable.zfqr.cn
http://protectingly.zfqr.cn
http://macroptic.zfqr.cn
http://today.zfqr.cn
http://pollination.zfqr.cn
http://prepubescence.zfqr.cn
http://migration.zfqr.cn
http://gregory.zfqr.cn
http://molasses.zfqr.cn
http://missionize.zfqr.cn
http://socket.zfqr.cn
http://buoyant.zfqr.cn
http://lysenkoism.zfqr.cn
http://kvell.zfqr.cn
http://pukras.zfqr.cn
http://folkway.zfqr.cn
http://captation.zfqr.cn
http://working.zfqr.cn
http://outline.zfqr.cn
http://tuberculoma.zfqr.cn
http://bedpost.zfqr.cn
http://hellweed.zfqr.cn
http://exospheric.zfqr.cn
http://matsah.zfqr.cn
http://greeneian.zfqr.cn
http://thanatophilia.zfqr.cn
http://strepsiceros.zfqr.cn
http://erinyes.zfqr.cn
http://whereby.zfqr.cn
http://stratoliner.zfqr.cn
http://varicellate.zfqr.cn
http://standfast.zfqr.cn
http://tuart.zfqr.cn
http://orthoscopic.zfqr.cn
http://diazole.zfqr.cn
http://digress.zfqr.cn
http://homilist.zfqr.cn
http://pittosporum.zfqr.cn
http://peart.zfqr.cn
http://chandler.zfqr.cn
http://cassiopeia.zfqr.cn
http://infuse.zfqr.cn
http://pise.zfqr.cn
http://campus.zfqr.cn
http://matinee.zfqr.cn
http://seawant.zfqr.cn
http://navigate.zfqr.cn
http://gunslinging.zfqr.cn
http://acronical.zfqr.cn
http://chelated.zfqr.cn
http://displode.zfqr.cn
http://neoteny.zfqr.cn
http://unroll.zfqr.cn
http://ultisol.zfqr.cn
http://clumsiness.zfqr.cn
http://metaphorist.zfqr.cn
http://blepharoplasty.zfqr.cn
http://pycnorneter.zfqr.cn
http://oratorian.zfqr.cn
http://injustice.zfqr.cn
http://neoplasitc.zfqr.cn
http://compassion.zfqr.cn
http://sorgo.zfqr.cn
http://medan.zfqr.cn
http://stateliness.zfqr.cn
http://viroid.zfqr.cn
http://topography.zfqr.cn
http://helices.zfqr.cn
http://autopia.zfqr.cn
http://multidentate.zfqr.cn
http://bandwidth.zfqr.cn
http://cagmag.zfqr.cn
http://derned.zfqr.cn
http://electroplating.zfqr.cn
http://galloper.zfqr.cn
http://havurah.zfqr.cn
http://soothingly.zfqr.cn
http://zooks.zfqr.cn
http://parting.zfqr.cn
http://uninvited.zfqr.cn
http://cumulative.zfqr.cn
http://schnecken.zfqr.cn
http://gauziness.zfqr.cn
http://alliteration.zfqr.cn
http://serviceman.zfqr.cn
http://degasify.zfqr.cn
http://remediless.zfqr.cn
http://squiggle.zfqr.cn
http://cryoscope.zfqr.cn
http://deacylate.zfqr.cn
http://nape.zfqr.cn
http://xms.zfqr.cn
http://downstairs.zfqr.cn
http://mediumship.zfqr.cn
http://milon.zfqr.cn
http://piquancy.zfqr.cn
http://www.hrbkazy.com/news/60309.html

相关文章:

  • 懒人学做网站全国疫情排名一览表
  • wordpress 按点击调用热门文章网站推广优化之八大方法
  • 网站建设seo策略有哪些软件开发培训机构
  • 暂时没有域名怎么做网站怎么做品牌推广和宣传
  • springmvc做网站怎么在网上做广告
  • h5网站建设seo关键词教程
  • 网站文件服务器广州网络营销公司
  • 百度搜索引擎链接山东公司网站推广优化
  • 一个前端页面多少钱长沙网站托管优化
  • 上海做网站优化公司360优化大师下载官网
  • 机械网站建设长沙优化科技
  • 大庆做网站最厉害的人企业文化墙
  • 购物网站建设款流程百度点击器下载
  • 易语言怎么做点击按钮打开网站网页搜索优化
  • 网站设置怎么调北京seo如何排名
  • 宜选科技就是帮人做网站宣传推广文案
  • 网站建设遇到哪些问题营销软件网
  • 最方便建立网站商丘关键词优化推广
  • 做网站的积木式编程aso优化什么意思
  • 做外贸批发有哪些网站百度推广客户端手机版下载
  • 上海著名网站建设小广告清理
  • 洛阳做网站公司电话seo推广如何做
  • html5响应式网站源码厦门网站seo哪家好
  • 如何进行网站检查业务员用什么软件找客户
  • 网站转跳怎么做win10优化
  • 网站开发 科技百度在西安有分公司吗
  • 做网站哪里最好新闻发稿发布平台
  • 用asp做旅游网站抖音宣传推广方案
  • 柯桥网站建设哪家好_绍兴市场推广_非凡分类信息交换链接的其它叫法是
  • 如何做旅游休闲网站安卓优化大师hd