Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select Query
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Select Query
Divers
Thread ID:
00692918
Message ID:
00692918
Vues:
64
Hi,
I need help with the Select-SQL statement.

I have a table, TAbleA from on which I execute a select query to retrieve all records that satisfy a certain criteria into a cursor CsrA.
Now I need to retrieve all records from TableA for which

- CsrA.fieldA = TableB.fieldA and
- TableB.fieldB = '101'

If I do a inner join on these tables, I get all records from cursor CsrA that meet this criteria, but records from csrA are repeated for every match found in TableB.

TableA and TableB have different structures. What I am trying to do is fetch all the records that meet the search criteria but having fieldB='101' and I do not have a fieldB in TableA.

What would be the best way to retrive all records only from cursorA for which TableB.fieldB='101'?

Select distinct csrA.* from csrA inner join TableB on ;
csrA.fieldA = TableB.fieldA ;
where TableB.fieldB='101'


would this query be the quickest way to achieve this?

Thank you.

Ria
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform