insert into select 语句
将一个表的数据导入到另一个表中,可以使用insert into select 语句
格式一:
insert into product2(pname,price) select pname,price from product;
格式二:
insert into product3 select category_id , count(*) from product group by category_id;
将一个表的数据导入到另一个表中,可以使用insert into select 语句
格式一:
insert into product2(pname,price) select pname,price from product;
格式二:
insert into product3 select category_id , count(*) from product group by category_id;