mysql
天涯悠草
我是一棵小小草!!
展开
-
mysql中的引擎
InnoDB:是一个可靠的事务处理引擎,它不支持全文搜索。MEMORY:功能等同于MyISAM,由于数据存储在内存中,速度很快,适合于临时表。MyISAM:性能极高的引擎,它支持全文搜索,但不支持事务处理。混合使用引擎有一点需要注意:外键不能跨引擎转载 2013-07-31 21:34:57 · 379 阅读 · 0 评论 -
mysql视图
mysql5添加了视图功能。使用视图的好处:1.简化查询语句2.保护数据视图的限制:1.名称要唯一2.授权3.视图不能索引create view testView asselect a1,a2,b1,b2 fromA1,B1 WHEREA1.ab = B.ab 视图一般不能用于更新操作。原创 2013-07-31 22:15:32 · 303 阅读 · 0 评论 -
mysql中的主键递增
CREATE TABLE customers( cust_id int NOT NULL AUTO_INCREMENT, cust_name char(50) NOT NULL , PRIMARY KEY (cust_id)) ENGINE=InnoDB; 第一次执行时:insert into customers values(1,'原创 2013-07-31 20:32:22 · 1336 阅读 · 0 评论 -
mysql更新表名
rename table customers2 to customers3;执行此sql语句后,customers2不复存在,只有customers3原创 2013-07-31 21:40:25 · 1065 阅读 · 0 评论 -
mysql智能存储过程
创建存储过程:create procedure ordertotal( in onumber int, in taxable boolean, out ototal decimal(8,2) ) COMMENT 'Obtain order total,optionally adding tax'be转载 2013-08-03 11:53:58 · 791 阅读 · 0 评论 -
mysql存储过程
创建一个存储过程:create procedure productpricing( out pl decimal(8,2), out ph decimal(8,2), out pa decimal(8,2))begin select min(prod_price) into pl from prod转载 2013-08-03 11:17:48 · 333 阅读 · 0 评论 -
mysql游标
说明:mysql游标只能用于存储过程中。创建存储过程:create procedure processorders()begin declare done boolean default 0; declare o int; declare t decimal(8,2); --定义游标 declare ord转载 2013-08-03 12:14:55 · 472 阅读 · 0 评论