读书人

MYSQL中新增一条记录时字段值得处理

发布时间: 2012-06-15 19:37:05 作者: rapoo

MYSQL中新增一条记录时,字段值得处理方法
打个比方
insert into tableA
(Id,Name)values
(值1,值2)
值1是传的参数,ID只是个比方..
值2是tableB中字段的值

求写法

不好描述的话,像我这样把写法体现出来就行,谢谢了~

[解决办法]
insert into tableA
select @t,zhi2 from tableB;
[解决办法]
insert into tableA
(Id,Name)
select @参数,值2 from tableB where id=3

读书人网 >Mysql

热点推荐