Table1```` Table2````````````````````` Table2
--------- 1 a .... ..---------------1 a .... ..
1 a I-- 2 c .... ..----result-----2 c .... ..
2 c II-- 2 b .... ..---------------7 d .... ..
7 d II-- 7 d .... ..
--------- 2 d .... ..
Are you trying to get everything from table2 that is in table1? Do you want the results in a seperate table or are you trying to delete them from table2? What are the names of those fields you show above in your example (would be nice so we could give you a working example)?
jimoo
F1, F2, F3, F4 field name
Table1```` Table2````````````````````` Table2
F1 F2 F3 F1 F2 F4 F1 F2 F4
1 k I 1 k .... ..---------------1 k .... ..
2 a I-- 2 a .... ..----result-----2 a .... ..
3 c II-- 2 b .... ..---------------3 c .... ..
7 d II-- 3 c .... .. 7 d
--------- 7 d .... ..
I have two tables, i'll compare field1 and field2 into table1 with field1 and field2 into table2. So, rows which are not exist table1 to be deleted from table2. /showing following example/
F1, F2, F3, F4 field name
Table1```` Table2````````````````````` Table2
F1 F2 F3 F1 F2 F4 F1 F2 F4
1 k I 1 k .... ..---------------1 k .... ..
2 a I-- 2 a .... ..----result-----2 a .... ..
3 c II-- 2 b .... ..---------------3 c .... ..
7 d II-- 3 c .... .. 7 d
--------- 7 d .... ..
how can i do? Please help me?
*select records from t2 which are not present in t1
SELECT TRANSFORM(f1,"99"+f2 FROM t2 ;
WHERE TRANSFORM(f1,"99"+f2 NOT in ( ;
SELECT TRANSFORM(f1,"99"+f2 FROM t1) ;
INTO CURSOR c1
*delete records from t2 which are in c1
DELETE FROM t2 WHERE TRANSFORM(f1,"99"+f2 ;
in (select * from c1)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.