03 2023 档案
摘要:TSQL脚本能实现递归查询,用户使用共用表表达式 CTE(Common Table Expression),只需要编写少量的代码,就能实现递归查询。 本文详细介绍CTE递归调用的特性和使用示例,递归查询主要用于层次结构的查询,从叶级(Leaf Level)向顶层(Root Level)查询,或从顶层
阅读全文
摘要:行转列的实现方式:使用mysql.help_topic --行转列 SELECT b.help_topic_id, substring_index( a.levels, ',', b.help_topic_id +1 ), substring_index( substring_index( a.le
阅读全文
摘要:1.tuple类型数据的获取 大家都知道,元组里面的数据获取只能通过下标的方式去获取,比如 :a = ('username', 'age', 'phone'),要获取username的话 ,就需要用a[0]的方式去获取,当元组中数据比较多的时候,用下标的方式获取数据就容易写错索引值。在这些场景下,用
阅读全文
摘要:方法一:不传递参数 ## 方式一、不传递参数 id = "01" name = "语文" sql = "select * from course where course_id = '%s' and course_name = '%s' ;" %(id,name) ## 执行数据库查询或命令 cur
阅读全文
摘要:执行函数时报错: Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8mb4_0900_ai_ci,IMPLICIT) for operation 'find_in_set' 问题原因: 大意是说:collation不兼容
阅读全文
摘要:创建函数时报错: 1418 - This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want
阅读全文