SQL :INSERT语句里嵌套查询语句的问题
INSERT INTO biao1(name,tel,adress,like,press,school,mem) VALUES (@姓名, @电话,@地址, @喜好, @经历, @学校, @备注)
现在想通过把在目标表biao2里查询出来的个别字段插入到源表biao1里:
表名为biao1的表里有字段id,name,tel,adress,like,press,school,mem
表名为biao2的表里有字段id,name,tel1,school1
在biao1里新加记录时候,想以name为查询条件从biao2里提取tel1赋值给tel,提取school1赋值给school
大概写了SQL语句:
insert into biao1(name,tel,school,adress,like,press,mem) (select name,tel1,school1 from biao2 where
biao1.name=biao2.name),@地址, @喜好, @经历,@备注
运行后提示语法错误,不知道到哪里错了,请大家帮忙,谢谢!!!
相关推荐
SQL子查询和嵌套查询
SQL子查询和嵌套查询
insert,update导出sql语句
insert,update导出sql语句,很实用的小工具
数据库表数据转为insert sql语句
Data row 2 insert sql Data row to insert sql是一个小的工具软件,可以将数据库表中指定数据转换成相应的insert sql语句。目前支持的数据库类型为oracle,db2,ms sql server。 目前还有一些缺陷,还有待完善,具体如下: 1、对ms sql server及其他数据库库中类似int identity的数据库类型没有处理,转出来的sql语句直接执行时,还需要做一下处理. 2、不支持长字符集类型.比如ms sql server中的image,oracle中的blob,clob,long以及db2中dbclob,graphic,long vargraphic等类型. 这个工具是本人利用闲暇时间所写,欢迎大家提意见.也可以向我索取源码. maito: henry.dhl@gmail.com thanks henry 2006/08/10
MaxCompute SQL中insert语句使用详情
MaxCompute insert语句使用 本文介绍使用INSERT OVERWRITE和INSERT INTO两种命令更新表数据,主要内容包括: insert into table … values …语句 insert into/overwrite … select …语句 Insert多路输出(MULTI INSERT) 输出到动态分区(DYNAMIC PARTITION) INSERT VALUES语句 命令使用 INSERT INTO TABLE tablename [PARTITION (partcol1=val1, partcol2=val2,...)][(co1name
导出SQL数据为Insert语句
自动判断当前数据库(目前支持SQL2000及以上版本)。将数据库中的数据导出为insert脚本。


