才学到INSERT语句!其中有个例句没看懂!帮忙解释一下!
use pubs
goinsert publishers
(pub_id, pub_name, city, state,country)
select '999'+left(pub_id,1),pub_name + '-2', city, state,countryfrom publishers
go
use pubs
goinsert publishers
(pub_id, pub_name, city, state,country)
select '999'+left(pub_id,1),pub_name + '-2', city, state,countryfrom publishers
go
其中..pub_id列.插入的字符串是'999'+left(pub_id,1)..就是字符串连接..把两个字符串相连.pub_name + '-2'也一样..
(pub_id, pub_name, city, state,country) --要插入的字段
select
'999'+left(pub_id,1),--将pub_id左边第一位与‘999’连接
pub_name + '-2',--将pub_name的值与‘-2’连接
city,
state,
countryfrom
publishers 整体的就是将原表中的数据修改,做为新记录插入到表中