用sql,数据库文件夹下面有两个子数据库
一个是A 一个是B
A中有个表table1,有个字段id1
B中有个表table2,也有字段id2
id1和id2有交叉数据
怎么写sql语句实现,我想用id1做为条件,去查询table2中有ID1字段的数据条、
将数据类型 varchar 转换为 numeric 时出错。
列出两个表的数据
select * from [AAA]..Table1 a inner join
[BBB]..Table2 b on a.id1 = b.id2
只BBB表里的数据
Select * from [BBB]..Table2 b where b.id2
in(Select a.id1 from [AAA]..Table1 a)
AAA和BBB是数据库名 数据库名和表名之间放两个点