Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Proper syntax with ODBC with sub select
Message
 
 
À
04/03/2006 17:28:14
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01101514
Message ID:
01101529
Vues:
9
Try
TEXT TO lcSql TEXTMERGE NOSHOW PRTEXT 15
SELECT Country.Numero, Country.<<gcReturnTitle>> AS Title, COUNT(DISTINCT School.Numero)
FROM FROM School 
JOIN Country ON School.NoCountry=Country.Numero 
WHERE School.Status=2
ORDER BY 2
ENDTEXT 
I'm not sure what field you shoud use in COUNT(DISTINCT School.Numero) because I don't know youtr tables structure/relationship.
Also notice how easier to maintain queries using TEXTMERGE.

>Well, I did go back to not having AutoInc. This simple lack of support from Microsoft made me realize the preparation to be as close as possible to SQL Server, as far as the VFP data structure goes, was a no go. I really need to use the ODBC approach to be as generic as possible. But, now I need to find a way to have a solution for a syntax that will allow me to have a ODBC query that will be done from a cursor. As this is not possible, the last think I want to do is to query into a table first and use the full path of that table, for my INNER JOIN, thru ODBC. Is there any other alternative to achieve that? Basically, I need to group first into a query and then INNER JOIN that.
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform