my sql 语句杂记

 

记录日常用过的sql语句。

很多sql语句,时间久了不太记得 语法 和用法。

平时 sql 语句也不是经常使用,所以在这里把日常使用过的mysql 语句记录下来,以备日后查看。

 

#在终端连接 mysql 数据库
#mysql -h hostIp  -u username  -p  password
mysql -h rm-bp1n852bj848xb286.mysql.rds.aliyuncs.com -u hq_oem_user -p BH0Vf23gBv5wI
 
use db_smart_assit;
 
show tables;
 
select * from t_msg limit 1;
 
select * from t_msg where sub_module_type=31 ;

 

 

#找到数据库 
use db_hq_price_alarm_gnn;

#多少用户创建了预警
select count( distinct uid) as uidNum from t_user_alarm_rules;


# 一共多少条预警
select count(*) as AlarmNum from t_user_alarm_rules;

 



use db_hq_price_alarm_gnn;
select * from t_user_alarm_rules
where uid="cshxj1 ";


use db_hq_price_alarm_gnn;
select * from t_user_info
where uid="cshxj1 ";


use db_hq_price_alarm_gnn;
select * from t_alarm_template
where type="5" order by alarmType ASC;



use db_hq_price_alarm_gnn;
select * from t_alarm_history
where uid="cshxj1";

 

 

###修改预警模板
use db_hq_price_alarm_gnn;

update t_alarm_template 
set content = CONCAT(content , " 盘中信号实时变化,仅作为预警参考,请以盘后信号为准。")
where msg_type_name= "智能信号" and type=3;

select *  from t_alarm_template 
where  msg_type_name="智能信号";

 

posted @ 2022-01-21 11:11  He_LiangLiang  阅读(45)  评论(0编辑  收藏  举报