Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sql statement question
Message
From
27/06/2005 02:42:28
 
 
To
27/06/2005 02:21:32
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01026614
Message ID:
01026617
Views:
15
Assuming that there is only one record per item code in each table....How about something like
SELECT * FROM myStockTableA;
UNION;
SELECT * FROM myStockTableB;
INTO CURSOR curTemp

SELECT itemCode FROM curTemp GROUP BY itemCode HAVING COUNT(*) > 1
This should get you a list of all item codes where there is some difference in the two tables.

This is what first came to mind for me. I have no idea how efficient this is on large tables, and wouldn't be surprised to find a better method suggested by someone else.



>Hi,
>
> I would like to compare two table. Those table will have same table structure that's their field and field type is totally same.
> Let said these two table is mystocktableA and mystocktableB, there will has a field ItemCode and both itemcode will have same value. Now, i want to do a table compare, by use their same itemcode, find out the rest fields which was not same. Since the table have 50 fields instead of use "And" to compare those fields, is it got another way to do ?
> Thanks.
>
>chang
Previous
Reply
Map
View

Click here to load this message in the networking platform