
SQL
LZD30
这个作者很懒,什么都没留下…
展开
-
MySQL中union和order by同时使用的实现方法。报错:Incorrect usage of UNION and ORDER BY
MySQL中union和order by是可以一起使用的,但是在使用中需要注意一些小问题,下面通过例子来说明。首先看下面的t1表。1、如果直接用如下sql语句是会报错:Incorrect usage of UNION and ORDER BY。SELECT * FROM t1 WHERE username LIKE 'l%' ORDER BY score ASCUNIONSELEC...转载 2019-04-23 11:11:50 · 8242 阅读 · 0 评论 -
索引导致死锁: ...jdbc4.MySQLTransactionRollbackException: Lock wait timeout exceeded; try ..
数据库的更新突然无法实现了,导致数据对接不过来异常如下:### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction; SQL []; Lock wait timeout exceed...原创 2019-05-14 12:08:45 · 2772 阅读 · 0 评论 -
使用exists替代in,原因及用法(sql的优化)
一、in、not in用法:1.doctors 表 的 id 存在 1,12,45,78 时,查询出来select * from doctors where id in (1,12,45,78)2.doctors 表 除了id 为1,12,45,78 的其它,查询出来select * from doctors where id not in (1,12,45,78)...原创 2019-03-27 10:30:28 · 4478 阅读 · 1 评论 -
c3p0 签出超时:resourcepool.TimeoutException: A client timed out while waiting to acquire a resource
全部异常:2019-08-19 14:33:49.860 |-ERROR [http-nio-8081-exec-317] org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/queue-admin].[dispatcherServlet] [181] -| Servlet.service() for servlet [...原创 2019-08-20 09:25:48 · 7539 阅读 · 1 评论