如何用SQL语句查询两张表中的相同字段数据
假设表1位table1 ,表2位table2
select a.col
from (select column_name col from user_tab_columns where table_name = 'table1') a ,
(select column_name col from user_tab_columns where table_name = 'table2') b
where a.col = b.col
这样就可以查询出两个表得相同字段了
用sql语句查询某表中拥有多个相同字段中的一个值
首先你要确定是哪个字段 如字段A 字段 B 中的值都是abc select * from 表名 where 字段A='abc' and 字段B='abc