Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Join on different data types
Message
 
À
21/02/2005 13:25:59
Joel Hokanson
Services Integration Group
Bellaire, Texas, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
00988924
Message ID:
00988938
Vues:
42
>I want to do a remote view and link tables on Vendor_number, however Vendopr_number in one table is Character 9 and it is an INT in other table.
>
>How do you join tables on different data types?
>
>table a Fields invoice_num, char 20 Vendor_number Char 9
>
>Table b Fileds Vendor_number INT vendor_name Chr 35
>
>I am trying to do a view that shows a.Invoice_num and b.Vendor_name
** No optimize for this
SELECT ... FROM TableA;
        .... JOIN TableB ON ALLTRIM(TableA.Vendor_number) = ALLTRIM(STR(TableB.Vendor_number))...

*** Depens of Indexes
SELECT ... FROM TableA;
        .... JOIN TableB ON PADR(ALLTRIM(TableA.Vendor_number),9) = PADR(ALLTRIM(STR(TableB.Vendor_number)),9) ...
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform