Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to select out latest generations of routes
Message
 
 
À
19/12/2005 12:21:52
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 7 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01079188
Message ID:
01079229
Vues:
16
Can you do select in VFP into a temp table and than feed it to MapInfo?

>I'd thought of something like that.
>
>As I later explained to Cetin:
>
>This query is to be achieved not with all-singing-and-dancing Visual FoxPro SQL, but with a very primitive version, from MapBasic (MapInfo's own poor version), so it hasn't got the same syntactic ability to alias the selects as you have.
>
>Perhaps I have a cheek to post the question here :-)
>
>SO I was hoping this could be done generically with very basic, cut-down SQL
>
>The MapBasic syntax is simply:
>
>Select  expression_list
>     From  table_name [ , ... ]   [ Where  expression_group ]
>  	 [ Into  results_table  ]
>  	 [ Group By  column_list ]
>  	 [ Order By  column_list ]
>
><b>and to make matters worse, the table_name can't be an intermediate select cursor from a previous SQL.
>
>It doesn't even feature "DISTINCT", and one can't have aliases to the subject tables. Why, I even have to convert the ASCII value of the gen letter, as MB's version of MAX() only works on numeric fields!!!
>
>
>>The following select should give you a list of latest generation for each route. After that you can join it with the stops table.
SELECT * FROM RZStop r1 ;
>>	WHERE r1.Gen = (SELECT MAX(Gen) FROM RZStop r2 WHERE r1.Rte_No = r2.Rte_No) ;
>>	INTO CURSOR crsLastRtGen
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform