Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sql statement question
Message
De
27/06/2005 02:42:28
 
 
À
27/06/2005 02:21:32
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01026614
Message ID:
01026617
Vues:
16
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform