07 2022 档案
摘要:with cte_child(id,areaName,pid) as ( --起始条件 select id,areaName,pid from erp_area where id = 44 --列出子节点查询条件 union all --递归条件 select a.id,a.areaName,a.p
阅读全文
摘要://获取树结构的科目public class GetSubjectTree{ public static List<TreeNode> GetTree(DataTable dt, DataTable _SubjectPopedom) { List<TreeNode> listNodes = new
阅读全文
摘要:with cte_child(id,areaName,pid) as ( --起始条件 select id,areaName,pid from erp_area where id = 44 --列出子节点查询条件 union all --递归条件 select a.id,a.areaName,a.p
阅读全文
摘要:with cte_child(id,areaName,pid,level)as( --起始条件 select id,areaName,pid,0 as level from erp_area where id = 1 -- 优先列出第一节点查询条件 union all --递归条件 select a
阅读全文
摘要:sql语句优化的30种方法 1.对查询进行优化,应尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引。 2.应尽量避免在 where 子句中使用!=或<>操作符,否则将引擎放弃使用索引而进行全表扫描。 3.应尽量避免在 where 子句中对字段进行 null 值判断
阅读全文