今天写代码的时候,有一个类的数据始终不能插入,老是提示在You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'describe, picPath1, picPath2, picPath3, picPath4, picPath5, agentId, belongStore' at li…
在做教务系统的时候,一个学生(alumni_info)有多个教育经历(alumni_education),使用的数据库是mysql,之前使用左链接查询的,发现数据量才只有几万条时,查询就很慢了,早上想到用子查询in,感觉效率还不是很高,结果想到用exists,效率高了很多.由于是第一次在mysql中使用exists,百度了一番,现将自己的总结如下: 1.exists的返回结果是bool型,只有true或者false 如 SELECT * FROM alumni_info t WHERE EXIS…
MySQL中any.some.all关键字http://blog.csdn.net/imzoer/article/details/8266324 ANY关键字: 假设any内部的查询语句返回的结果个数是三个, 那么, select ...from ... where a>any(...) -> select ...from ... where a > result1 or a > result2 or a > result3 ALL关键字: ALL关键字与any关键字类似,只…
MySQL 中数据类型常用的就三大类: 数字类型/numeric types 日期和时间/date and time types 字符类型/string (character and byte) types 另外还包含两个没那么常用的大类: 特殊类型/spatial types JSON 继续之前,先来看一些单位上的约定和概念, M:根据具体不同的类型,其表示的意思不一样,见下方关于这个参数的讨论. D 用于定点及浮点数,表示小数点后有多少位.最大可能取值为 30,但不应该超过 M-2. fsp…
MySQL中show语法 1. show tables或show tables from database_name; -- 显示当前数据库中所有表的名称. 2. show databases; -- 显示mysql中所有数据库的名称. 3. show columns from table_name from database_name; 或show columns from database_name.table_name; -- 显示表中列名称. 4. show grants for use…
1. show tables或show tables from database_name; -- 显示当前数据库中所有表的名称. 2. show databases; -- 显示mysql中所有数据库的名称. 3. show columns from table_name from database_name; 或show columns from database_name.table_name; -- 显示表中列名称. 4. show grants for user_name; -- 显示…