摘要: TSQL脚本能实现递归查询,用户使用共用表表达式 CTE(Common Table Expression),只需要编写少量的代码,就能实现递归查询。 本文详细介绍CTE递归调用的特性和使用示例,递归查询主要用于层次结构的查询,从叶级(Leaf Level)向顶层(Root Level)查询,或从顶层 阅读全文
posted @ 2023-03-27 16:48 业余砖家 阅读(1936) 评论(0) 推荐(0) 编辑
摘要: 行转列的实现方式:使用mysql.help_topic --行转列 SELECT b.help_topic_id, substring_index( a.levels, ',', b.help_topic_id +1 ), substring_index( substring_index( a.le 阅读全文
posted @ 2023-03-27 16:07 业余砖家 阅读(73) 评论(0) 推荐(0) 编辑