SELECT *
FROM A FULL OUTER JOIN B
ON A.xm=B.xm
或者
SELECT *
FROM A FULL OUTER JOIN B
USING(xm)
或者
SELECT *
FROM A NATUREL FULL OUTER JOIN B

解决方案 »

  1.   

    select a.xm,a.filed1,b.field1 from a,b
    where a.xm=b.xm
      

  2.   

    select A.*,B.* from a,b
    where a.xm=b.xm
      

  3.   

    表A:
    select * from a
    where xm in (
    select xm from (
    select xm from a
    union all
    select xm from b
    ) as c
    having count(xm)>1
    )表B:
    select * from b
    where xm in (
    select xm from (
    select xm from a
    union all
    select xm from b
    ) as chaving count(xm)>1
    )
      

  4.   

    表A:
    select * from a
    where xm in (
    select xm from (
    select xm from a
    union all
    select xm from b
    ) as c
    having count(xm)>1
    )表B:
    select * from b
    where xm in (
    select xm from (
    select xm from a
    union all
    select xm from b
    ) as chaving count(xm)>1
    )
      

  5.   

    临时表~~我倒忘记了,我试试吧。
    select *  from xmjlb
    where (xm) in
     (
    select xm from xmjlb 
    group by xm
    having count(*)>1
    )
    order by xm
    这是在一个表中查询重复数据的代码,weixy(),你帮我研究一下怎么在一个语句用嵌套实现,我来看看临时表,只要有一个方法实现就行了。谢谢谢谢!!!
      

  6.   

    有点错误:表A:
    select * from a
    where xm in (
    select xm from (
    select xm from a
    union all
    select xm from b
    ) as c
    group by xm
    having count(xm)>1
    )表B:
    select * from b
    where xm in (
    select xm from (
    select xm from a
    union all
    select xm from b
    ) as c
    group by xm
    having count(xm)>1
    )合在一起,要求:只能查询两表都有的字段。select * from (
    select 'a' as fromtable,xm,col1,col2... from a
    union all
    select 'b' as fromtable,xm,col1,col2... from b
    ) as d
    where xm in (
    select xm from (
    select xm from a
    union all
    select xm from b
    ) as c
    group by xm
    having count(xm)>1
    )
      

  7.   

    YEAH!@!!!!!!!!!!!!!!
    成功!!!!
    Yang_(扬帆破浪) 牛!!!!!!!
    加五十!!!