摘要:
两个事务操作: set autocommit=off; A: begin; select * from students where id=1 for update; B: begin; select * from students where id=1; 显示结果(直接查询,无需获得锁) sele 阅读全文
摘要:
CREATE TABLE students( id INT PRIMARY KEY, NAME VARCHAR(11)); CREATE TABLE courses( id INT PRIMARY KEY, NAME VARCHAR(11)); CREATE TABLE scores( sid IN 阅读全文
摘要:
UPDATE emp e SET e.salary=e.salary+7 WHERE e.id IN(SELECT e1.id FROM emp e1,dept d WHERE e1.dep_id=d.id AND d.name='开发一部' AND e1.salary<2000); 不能先sele 阅读全文
摘要:
select type, sum(case monthst when 1 then numbers else 0 end ) 一月, sum(case monthst when 2 then numbers else 0 end ) 二月, sum(case monthst when 3 then 阅读全文