>I have pulled data from two separate SQL tables, and I need to find which rows are different. They have exactly the same structure.
>
>I have the two views which I will call cFirstSQL and cSecondSQL and I did the following thinking that this would work;
>
>SELECT * from cFirstSQL WHERE NOT EXSISTS (SELECT * FROM cSecondSQL)
>
>I get not data, and there are differences.
Mark,
I don't know a practical way of doing this with just one SQL. But a small routine :
LPARAMETERS tcTable1, tcTable2
LOCAL lcGroupBy, ix
USE (tcTable1) in 0 again alias myAlias
lcGroupBy = ""
FOR ix = 1 to fcount("myAlias")
lcGroupBy = lcGroupBy+iif(empty(lcGroupBy),"",",")+padl(ix,3,"0")
ENDFOR
USE in "myAlias"
SELECT * from (tcTable1) ;
union all ;
select * from (tcTable2) ;
into cursor myCursor
SELECT * from myCursor ;
having cnt(*)>1 ;
group by &lcGroupBy ;
into cursor crsDupRecs
BROW
Cetin