mysql常用命令和语句

 大小写: MySQL默认情况下是否区分大小写,使用show Variables like '%table_names'查看lower_case_table_names的值,0代表区分,1代表不区分。

查看环境配置:SHOW VARIABLES,模糊匹配可使用:SHOW VARIABLES LIKE '%max_allowed%';

使用IDEA连接数据库,注释乱码,在后面添加:jdbc:mysql://localhost:3306/ssm-demo?characterEncoding=UTF-8 

 

etl:

SELECT a.cardId,a.logTime,a.payable,b.cnt
FROM t_heigorecharge201704 a,
(select cardId,count(*) cnt from t_heigorecharge201704 group by cardId)b
where a.cardId=b.cardId
ORDER BY a.payable DESC ;

 


posted @ 2017-06-13 20:30  练好本领,报国杀敌  阅读(171)  评论(0编辑  收藏  举报