ng new my-project --style less cd my-project ng add ng-alain
add library 和 npm install
ng add \ uses your package manager and installs the dependency. That dependency can have an installation script which can be used to do more job except the dependency installation. It can update your configurations, download another dependencies based on that one or create scaffold templates (with initial markup and logic).
异常:kex_exchange_identification: read: Software caused connection abort. banner exchange: Connection to 20.205.243.166 port 22: Software caused connection abort fatal: Could not read from remote repository.
MySQL读取csv数据不能识别bom头,遇到utf8bom报“Can’t analyze file. Please try to change encoding type. If that doesn’t help, maybe the file is not: csv, or the file is empty.
show databases; create database csc; use csc; show tables;
联合更新
1 2
update asset a inner join department d on a.depart_id=d.depart_id set a.department=d.depart_name where a.department <> d.depart_name
key, primary key, unique key
分组取第一条
MySQl 8 之前的版本不支持partition by
1 2 3 4
select * from ( select *,row_number() over(partition by Grade order by Score desc) as Sequence from Student )T where T.Sequence<=1
workaround
1 2 3 4 5 6 7 8 9 10
SELECT t1.* FROM action_history t1 INNER JOIN (SELECT MAX(timestramp) AS newest, process_id FROM action_history GROUP BY process_id) t2 ON t2.process_id = t1.process_id AND t2.newest = t1.timestramp
加/减后缀
1 2 3 4 5 6
UPDATE all_user SET email = CONCAT(email, '_disabled') WHERE email NOT LIKE '%yopmail.com' AND user_id < 108
去后缀,即取该字段的左起(总长度-后缀长度)个字符
1 2 3 4 5 6
UPDATE all_user SET email = LEFT(email, LENGTH(email) - 9) WHERE email NOT LIKE '%yopmail.com' AND user_id < 108
查询各表数据条数
1 2
USE information_schema; SELECT table_name,table_rows FROM TABLES WHERE TABLE_SCHEMA = 'ams'