mysql细节补充

1. 直接就是 把 结果插入到  新建的表中

select * from userxxd;
insert into userxxd VALUES (1,'大炮','武器');

CREATE table brand(
a int not null auto_increment,
primary key (a), 
brand varchar(20) 
)
SELECT brand from userxxd where id=1;

select * from brand;


2. 使用结果 插入 到 表中

INSERT into brand(brand) SELECT brand from userxxd where id=1;


3. 创建 自定义的

   create    function  f1() return int 

 return   date_formate( now(),'%y-%M-%d');

create    function  f1(sum int ,sum2 int ) return int 

 returns   float( now(),'%y-%M-%d');


4.  添加 默认值

alter table brand
 add column
   `purchase_dt` TIMESTAMP   DEFAULT  CURRENT_TIMESTAMP();



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值