
db_mysql
taking_wang
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
[转]MySQL存储过程调试工具-dbForge Studio for MySQL
下载带debug版本,也就是需要收费的工具官网地址:http://www.devart.com/dbforge/mysql/studio/ 本文转自:http://blog.chinaunix.net/uid-26364035-id-3179231.html对于某些存储过程很多且复杂的SQL的应用,在短时间内要使得所有MySQL存储过程和函数正常运行,那么如果能找到一个比转载 2014-11-03 18:30:42 · 523 阅读 · 0 评论 -
mysql多表多字段关联删除
eg:delete t1 from table1 t1, table2 t2 where t1.fkcustomerid = t2.fkcustomerid and t1.fkpersonid = t2.fkpersonid and t1.fcooperationtype = t2.fcooperationtype and t1.fid not in (select原创 2017-07-14 12:59:06 · 3318 阅读 · 0 评论 -
MySQL定时执行脚本(计划任务)命令实例
转自:http://www.jb51.net/article/42440.htm查看event是否开启复制代码代码如下:show variables like '%sche%'; 将事件计划开启复制代码代码如下:set global event_scheduler =1; 创建存储过转载 2017-08-22 15:20:13 · 417 阅读 · 0 评论 -
警惕 MySql 更新 sql 的 WHERE 从句中的 IN() 子查询时出现的陷阱
转自:http://blog.youkuaiyun.com/defonds/article/details/46745143mer_stage 表有 216423 条记录,DDL:[sql] view plain copy print?CREATE TABLE `mer_stage` ( `STAGE_ID` int(11) NOT NULL AU转载 2017-03-22 16:44:27 · 4467 阅读 · 0 评论 -
MySQL 事务没有提交导致 锁等待 Lock wait timeout exceeded
转自:http://blog.youkuaiyun.com/tanggao1314/article/details/53097561Lock wait timeout exceeded当一个SQL执行完了,但未COMMIT,后select * from information_schema.innodb_trx 之后找到了一个一直没有提交的只读事务,转载 2017-03-22 16:05:23 · 570 阅读 · 0 评论 -
从数据库表中随机获取N条记录的SQL语句
Oracle: select * from (select * from tableName order by dbms_random.value) where rownum eg: select * from (select * from t_bd_person order by dbms_random.value) where rownum MS SQLServ转载 2016-03-24 09:51:31 · 13690 阅读 · 0 评论 -
mysql 查询某张表的字段
use information_schema;select column_name,COLUMN_COMMENT,DATA_TYPE from information_schema.columns where table_schema ='init(schema的名字)' and table_name = 't_bc_belongperson(表名)';原创 2014-12-10 11:20:20 · 1078 阅读 · 0 评论 -
mysql 动态按季度创建表
create procedure parttablecreatecfProc() BEGIN declare yearsuffix varchar(20); declare quartersuffix varchar(20); declare createParttableSql varchar(500); declare existFlag int default原创 2015-01-14 15:27:11 · 696 阅读 · 0 评论 -
mysql 存储过程
CREATE PROCEDURE updateTradePerformanceData()BEGIN declare stopFlag int; declare parentOrgId varchar(100); declare orgaid varchar(100); DECLARE dataid varchar(10原创 2014-12-17 10:06:09 · 402 阅读 · 0 评论 -
MySQL拼音首字母查询
转自:http://blog.youkuaiyun.com/naruto1021/article/details/17502783最近一个项目中有个模块需要实现拼音首字母查询功能,网上查了一下资料,自己重新修改整理了一下,使其满足项目的要求。实现过程如下:1.创建一个获取中英文大写首字母函数:[html] view plain copyDROP转载 2017-09-20 09:31:44 · 711 阅读 · 0 评论