![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
SQL
RaySunWHUT
I am a coder and at the same time, I am a writer.
自认国学初窥门径,写文章胜过写程序。
个人主页: https://raysunwhut.github.io/
展开
-
MyBatis: 插入一条数据,并返回这条数据的主键id
MyBatis: 插入一条数据,并返回这条数据的主键id原创 2020-02-14 15:40:05 · 1114 阅读 · 0 评论 -
SQL:insert 与where不可连用
SQL:insert 与where不可连用原创 2020-02-14 14:39:19 · 1666 阅读 · 0 评论 -
MyBatis: delete、update、insert等语句的操作返回值
MyBatis:< delete >、< update >、< insert >等语句的操作返回值原创 2020-02-14 14:34:18 · 1356 阅读 · 0 评论 -
MySQL:MySQL5.7.21安装教程
MySQL5.7 64位 zip文件安装教程到官网下载MySQL5.7.zip。将解压后的bin目录添加到环境变量的Path中。在MySQL根目录创建my.ini文件,文件内容为: # For advice on how to change settings please see# http://dev.mysql.com/doc/refman/5.6/en/server-confi...原创 2019-11-22 23:09:30 · 257 阅读 · 0 评论 -
MySQL涉及4张表的级联查询
inner join的使用数据库表之间的级联查询使用“join … on …” 关键字。级联join分为:joininner joinleft joinright joinfull join四种join查询的区别:JOIN: 如果表中有至少一个匹配,则返回行;INNER JOIN:在表中存在至少一个匹配时,返回行。LEFT JOIN: 即使右表中没有匹配,也从左表返回所...原创 2019-10-27 10:43:11 · 9543 阅读 · 0 评论 -
SQL异常:Cause: java.sql.SQLException: Value '0000-00-00 00:00:00' can not...
Cause: java.sql.SQLException: Value ‘0000-00-00 00:00:00’ can not be represented as java.sql.Timestamp这个错误的原因是:Java的时间戳Timestamp类无法表示***0000-00-00 00:00:00***这个时间;由于计算机的时间是从格林威治时间 1970年01月01日00时00分...原创 2019-10-26 19:17:08 · 666 阅读 · 0 评论 -
操作以“order”为名称的数据库表产生的Bug
一个SQL语法异常的神Bug!今天在做数据库实验时,出现了一个让人捉摸不透的Bug:从数据进行非常正常的select操作,居然无效!!!我心想,即使数据库表中没有存储数据,也不能报语法错误啊!况且我试着select其他表进行操作,也是有用的。百般无奈之后,改了“order”表的表名:结果就是一切正常了!!!猛然想起,数据库中一个关键操作的字段叫做:order bySQL中的...原创 2019-10-26 17:58:40 · 509 阅读 · 0 评论 -
MyBatis报错:org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.type.Type
Cause: java.sql.SQLException: Parameter index out of range (2 > number of parameters, which is 1).这是一个神奇的bug。当我的MyBatis语句为: <select id="getRoleByUserAccount" resultType="com.alibaba.fastjs...原创 2019-10-26 11:56:54 · 3066 阅读 · 3 评论 -
MySQLIntegrityConstraintViolationException: Column 'roleId' in field list is ambiguous
MySQLIntegrityConstraintViolationException <select id="getRoleByUserAccount" resultType="sun.lab.domain.Role" parameterType="String"> select roleId, r.roleName from role r, user u ...原创 2019-10-26 01:16:15 · 578 阅读 · 0 评论