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="智能信号";
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?