SQL常见问题及解决备忘
2024-08-25 21:18:05
1.mysql中:you cant't specify tartget table for update in from clause 错误
含义:在同一语句中update或delete某张表的时候,该表不能子查询from的表
eg:错误的sql
delete from table_name where pid in ( select pid from table_name group by pid having count() > )
eg:修改后的sql
delete from t where pid in (
select temp.pid from (
select pid from t
group by pid HAVING count()>
) temp
)
2.mysql错误:Every derived tabled must have its own alias
含义:每个派生出来的表都需要有一个自己的别名
解决:一般在多表查询的时候,会出现此错误。因为进行嵌套查询的时候子查询出来的结果是作为一个派生表来进行上一级查询的,所以子查询的结果必须要有一个别名。
最新文章
- 用SQLMAP工具进行SQL注入
- 爱上MVC~MVC4模型验证可以放在前端
- 使用jquery再次封装ajax
- Notes of Principles of Parallel Programming: Peril-L Notation - TODO
- Linux下TOmcat调试命令
- google api , the problem of null refresh token
- 模式对话框里的CheckedChanged事件
- vim spf13
- PHP判断远程图片或文件是否存在
- 最少步数(bfs)
- 杭电OJ分类
- Gradle创建项目(IntelliJ IDEA)
- SonarLint 代码质量管理
- luogu P4385 [COCI2009]Dvapravca
- koa和express对比
- C字符串
- Django使用AJAX调用自己写的API接口
- 漫谈NIO(2)之Java的NIO
- Hacknet 玩后感
- error occurred during initialization of vm
热门文章
- sql语句中的join连接(左连接、右连接、全连接、内连接)
- JS 调用存储过程传递参数
- 【bzoj3489】A simple rmq problem 三维KD-tree
- POJ——1364King(差分约束SPFA判负环+前向星)
- C 语言中可以调用命令行指令的 system()函数
- 浅谈java内存泄漏
- android soap webservers 无法执行 报错 ht.call(SOAP_ACTION, envelope);解决方法
- go--time包
- WEB学习-基础知识:列表、表单、div和span、注释、字符实体、HTML废弃标签介绍
- css3 nth-child 与 nth-of-type 的区别