那些臭名昭著的sql

简介: 两个或多个表关联,没写where条件,大量的笛卡尔值,严重时会导致数据库有问题。 select * from a, b left join c on b.id = c.id left join d on c.id = d.id 多表关联查询,where条件使用各种函数,导致索引无效。
  • 两个或多个表关联,没写where条件,大量的笛卡尔值,严重时会导致数据库有问题。
select * from a, b left join c on b.id = c.id left join d on c.id = d.id
  • 多表关联查询,where条件使用各种函数,导致索引无效。数据量如果打起来以后会导致查询像蜗牛一样。
select 
trim(d.circuitid) as circuitid,
trim(d.Code) as Code,
trim(d.Oldname) as Oldname,
trim(d.Circuittype) as Circuittype,
trim(d.Status) as Status,
trim(d.customerid) as acustomerid,
trim(d.alinkman) as alinkman,
trim(d.zlinkman) as zlinkman,
trim(d.alinkmantel) as alinkmantel,
trim(d.zlinkmantel) as zlinkmantel,
trim(d.busi_no) as busi_no,
trim(d.service_serial) as service_serial,
trim(a.region_ID) as regionid ,
2 as SORTID
from test1 a,test2 b,test3 c,test4 d 
where trim(a.room_id)=trim(b.roomID) and trim(b.neid)=trim(c.neid) and (trim(c.portid)=trim(d.aendname) or trim(c.portid)=trim(d.zendname))

 

相关文章
|
12天前
|
人工智能 自然语言处理 文字识别
阿里云百炼Qwen3.7-Max简介:能力、优势、支持订阅计划参考
Qwen3.7-Max是阿里云百炼面向智能体时代推出的新一代旗舰模型,对标GPT-5.5、Claude Opus 4.7等闭源旗舰。该模型支持百万级token上下文窗口,具备顶级推理能力、多模态搜索与视觉理解增强、流式输出低延迟响应等核心优势,覆盖编程、办公、长周期自主执行等复杂场景。同时支持OpenAI接口兼容,便于系统快速迁移。用户可通过Token Plan团队或节省计划等订阅方式灵活调用,适合企业级高要求场景使用。
4871 23
阿里云百炼Qwen3.7-Max简介:能力、优势、支持订阅计划参考
|
7天前
|
存储 定位技术 数据库
CodeGraph 如何让 Claude Code减少 7 成工具调用?
CodeGraph 为 Coding Agent 提供本地代码知识图谱,把函数、类、调用链和框架路由提前整理成“项目地图”,减少盲目搜索和文件读取。它不是新 Agent,而是上下文基础设施,让 Agent 更快找到正确代码路径,平均减少 7 成工具调用。
946 0
|
14天前
|
人工智能 自然语言处理 供应链
|
4天前
|
人工智能 安全 定位技术
CodeGraph深度解析 让Claude Code工具调用直降七成的核心原理与实操教程
如今以Claude Code为代表的AI编程智能体已经成为开发者日常编码、项目重构、漏洞修复的必备工具。但在长期使用过程中,几乎所有开发者都会遇到同一个明显痛点:AI虽然具备强大的代码生成与分析能力,却常常陷入盲目探索的循环中。
594 1
|
20天前
|
人工智能 开发工具 iOS开发
Claude Code 新手完全上手指南:安装、国产模型配置与常用命令全解
Claude Code 是一款运行在终端环境中的 AI 编程助手,能够直接在命令行中完成代码生成、项目分析、文件修改、命令执行、Git 管理等开发全流程工作。它最大的特点是**任务驱动、终端原生、轻量高效、多模型兼容**,无需图形界面、不依赖 IDE 插件,能够深度融入开发者日常工作流。
3752 15
|
16天前
|
人工智能 Linux BI
国内用 Claude Code 终于不用翻墙了:一行命令搞定,自动接 DeepSeek
JeecgBoot AI专题研究 一键脚本:Claude Code + JeecgBoot Skills + DeepSeek 全平台接入 一行命令装好 Claude Code + JeecgBoot Skills + DeepSeek 接入,无需翻墙使用 Claude Code,支持 Wind
3382 10
国内用 Claude Code 终于不用翻墙了:一行命令搞定,自动接 DeepSeek