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();