1、统计字符出现次数
select * from sys_ehrdepartment where dep_name like 'FTU%' AND (length(layer_path)-length(replace(layer_path,'/','')))<4
2、查询数据库状态
show status like '%read';---吞吐量
show status like 'uptime';
show status like 'con%';---连接数
3、脏数据生成存储过程
drop PROCEDURE add_wenjuan;
call add_wenjuan(2);
delimiter $$
CREATE DEFINER=`root`@`%` PROCEDURE add_wenjuan(IN n INT)
BEGIN
DECLARE i INT DEFAULT 1;
DECLARE xx_id BIGINT(11) DEFAULT 1;
DECLARE xx_id BIGINT(11) DEFAULT 1;
WHILE i < n DO
INSERT INTO `xx` (`xx_name`,----) VALUES (CONCAT('问卷-00',i), ----);
set x_id=last_insert_id();
INSERT INTO `xx` (`xxe_id`, ---) VALUES (xx_id, ---);
set question_id=last_insert_id();
INSERT INTO `x` (`xx`, `xx`, `xx`, `x`, `x`, `x`, `x`, `x`) VALUES (NULL, CONCAT('猫屎咖啡种类',i), question_id, 1524031066973, 917327, NULL, NULL, 0);
SET i = i + 1;
END WHILE;
END$$