Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using max() command correctly in sql
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Using max() command correctly in sql
Divers
Thread ID:
00692081
Message ID:
00692081
Vues:
60
I am trying to get the last value entered as a character in a table using max command: Here is what my test data looks like
table1:
id   vname
============
100 veh1
200 veh2
table2:
id   name
=============
100 "James"
200 "tammy"
100 "john"
100 "cindi"
200 "angie"
I am trying to get max value from table2 "name" column for each vname in table1 using sql statement. Here is the statement that I did but it didn't produce right results.
SELECT Table1.id. Table1.vname,  max(Table2.name);
 FROM  fleet!table1 INNER JOIN fleet!table2 ;
   ON  Table1.id = Table2.id
I need the results to be
100  veh1  "cindi"
200  veh2  "angie"
I'm I doing the max wrong on characters? What is the correct way to do it.

Thanks
Nick Patel
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform