关于update关联表的写法存在很多误区,以前我自己也经常犯错....一般的写法有如下几种:update test1 set name =(select name from test2 where test1.id=test2.id);update test1 a,test2 b set a.name=b.name where a.id=b.id;update test2 set test2.name=(select name from test1 where test1.id=test2.id) ...【阅读全文】
文章来源:http://zhongwei-leg.iteye.com/blog/899227使用 mysql 创建数据表的时候, 总免不了要涉及到 character set 和 collation 的概念, 之前不是很了解。 这两天不是很忙, 就自己整理了一下。 先来看看 character set 和 collation 的是什么?&. character set, 即字...【阅读全文】
select...lock in share mode和select...for update一直模模糊糊的.. 这次刚好碰到..就测了一把... 首先看官方的说明: SELECT ... LOCK IN SHARE MODE sets a shared mode lock on the rows read. A shared mode lock enables other sessions to read the rows but not to modify them. The rows read...【阅读全文】
今天写了一存储过程,执行过程后,查看目标表数据,有一字段居然显示乱码,经过修改,数据显示正常存储过程代码如下:点击(此处)折叠或打开DELIMITER $$ DROP PROCEDURE IF EXISTS `p_ap_heart_down_warning`$$CREATE PROCEDURE ...【阅读全文】