Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Avoid the _a and _b when selecting * from both tables?
Message
De
12/10/2004 17:14:04
 
 
À
12/10/2004 16:33:31
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00950839
Message ID:
00950863
Vues:
12
This is an example of a technique which I used. This code may need some "tweaking" but this is just a rough example of how yoiu may approach the problem.
LOCAL lcSQL
lcSql = ''
SELECT tablea
COPY STRUCTURE EXTENDED TO tempstru
SELECT 0
USE tempstru 


SET TEXTMERGE ON TO memvar lcSQL noshow
\SELECT tablea.*
FOR i = 1 TO AFIELDS(lafields,'tableb')
	LOCATE FOR lafield(i,1)+' ' = field_name+' '
	IF NOT FOUND()
		\\,tableb.<<lafield(i,1)>>
	ENDIF 
ENDFOR
\\ from tablea, tableb where your matching expression into cursorc
SET TEXTMERGE to
SET TEXTMERGE off
&lcSql
Glenn

>Any way without having to specify the actual fields to get all the columns from table A, named as they exist, and then all the remaining fields from table B. I do not want to specify the fields that are common to both tables. I want matching records and only 1 occurance of all columns.
>
>For example:
>
>
>SELECT TableA.*, TableB.* WHERE A.Fieldx = B.Fieldx
>
>
>With the result being:
>
>
>Field1, Field2, Field3...
>
>
>Not:
>
>
>Field1_a, Field1_b, Field2, Field3...
>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform