Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Tricky sql selection
Message
 
À
16/02/2001 15:57:03
Bob Lucas
The WordWare Agency
Alberta, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00476778
Message ID:
00476901
Vues:
25
>One thing you can do is to create a view of the position table
>
>CREATE VIEW vPosition AS
>SELECT position.possid, MAX(position.posdate) as posdate;
> FROM position;
> GROUP BY position.posid
>
>
>Then your select will be:
>
>select a.Actsid, a.Actssn, a.Actfname, a.Actmname, a.Actlname, p.posname, p.posdate;
> from actives a left outer join vPosition p ON a.ACTSID = p.POSSID;
> where possid = a.actsid ;
> order by actlname
>

The problem with this is that posname is not a field in vPosition, and you can't add it to the first query - it will not select the posname for the right record.
Doru
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform