摘要: 如上图,我们想查询出所有地区的数据,如果这样查询 select * from dict where parent_id=3 结果: ,肯定不是我们想要的所有子级数据 正确查询方式: with temp as ( select * from dict where parent_id=3 union a 阅读全文
posted @ 2021-07-15 16:53 kueizheng 阅读(195) 评论(0) 推荐(0) 编辑
摘要: 定义函数: CREATE FUNCTION [dbo].[GetAge] ( @BirthDay nvarchar(20) --生日 ) RETURNS varchar(20) AS BEGIN if(@BirthDay is NUlL or @BirthDay='') return ''; -- 阅读全文
posted @ 2021-07-15 16:04 kueizheng 阅读(520) 评论(0) 推荐(0) 编辑