随笔分类 -  Mysql

摘要:-- 插入触发器 DELIMITER // create trigger triggerName <after | before> insert on tableName FOR EACH ROW begin if begin -- new.xx, new.xx (可以拿到插入到表tableName 阅读全文
posted @ 2021-06-07 09:33 学无止境-小蜗牛 阅读(65) 评论(0) 推荐(0)
摘要:通过linq以及 sql参数化查询方式可以实现 using (MysqlTestDB db = new MysqlTestDB()) { //linq List<int> idList = new List<int>() { 1, 2 }; var retLinq = db.tb_tests.Whe 阅读全文
posted @ 2020-11-26 15:04 学无止境-小蜗牛 阅读(338) 评论(0) 推荐(0)
摘要:转自 :14 | count(*)这么慢,我该怎么办? 丁奇老师的极客时间专栏 mysql45讲。 1- 对于 count(字段) 来说: 如果这个“字段”是定义为 not null 的话,一行行地从记录里面读出这个字段,判断不能为 null,按行累加; 如果这个“字段”定义允许为 null,那么执 阅读全文
posted @ 2020-09-18 17:21 学无止境-小蜗牛 阅读(447) 评论(0) 推荐(0)