MySQL
易醒是好梦
There is only one success to be able to spend your life in your own favorite way
展开
-
mybatis update mapper.xml
User user =new User();user.setId("dsfgsdfgdsfgds");user.setUsername("wyw");user.setPassword("wyw");user.setEmail("wyw@163.com");XxxMapper.updateByPrimaryKey(user);//相当于:update user set username='wyw', password='wyw', email='wyw@163.com' where id='ds.原创 2020-10-29 14:01:29 · 846 阅读 · 0 评论 -
mybatis 查询 mapper.xml
public List<XXBean> getXXBeanList(String xxCode); <select id="getXXXBeanList" parameterType="java.lang.String" resultType="XXBean"> select t.* from tableName t where t.id= #{id} </select> 其中方法名和ID一致,#{}中的参数名与方法中的参数名一直, 我这里采用的是...原创 2020-10-29 11:36:05 · 241 阅读 · 0 评论 -
MySQL sql select
SET FOREIGN_KEY_CHECKS=0;-- ------------------------------ Table structure for `grade`-- ----------------------------DROP TABLE IF EXISTS `grade`;CREATE TABLE `grade` (`id` bigint(20) NOT NULL...转载 2019-04-25 18:19:03 · 332 阅读 · 0 评论 -
MySQL 查询 表 容量大小 索引大小
## 所有数据库selecttable_schema as '数据库',sum(table_rows) as '记录数',sum(truncate(data_length/1024/1024, 2)) as '数据容量(MB)',sum(truncate(index_length/1024/1024, 2)) as '索引容量(MB)'from information_schema....原创 2019-08-13 17:25:45 · 1082 阅读 · 0 评论 -
MySQL 按时间统计
## 年月日总数select count(1) as total_fee,DATE_FORMAT(regtime,"%Y-%m-%d") as dayfrom user a group by DATE_FORMAT(regtime ,"%Y-%m-%d");select count(1) as total,DATE_FORMAT(regtime,"%Y-%m") as day...原创 2019-08-14 15:27:38 · 455 阅读 · 0 评论 -
mysql command not found
mysql-bash: mysql: command not found## 添加环境sudo suvim /etc/profile添加export PATH=$PATH:/usr/local/mysql/bin执行 生效source /etc/profile原创 2019-08-14 19:22:37 · 141 阅读 · 0 评论