Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Group by in a union clause error, (not the usual one)
Message
De
04/10/2005 15:46:17
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Titre:
Group by in a union clause error, (not the usual one)
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01056034
Message ID:
01056034
Vues:
58
I've got a view that looks like this...

Select xtable.id from Xtable where xtable.id in (select min(xtable.id) from xtable group by xtable.foreignkey)

It's a view to return the first address for each person that has addresses. (Yep, likely not the best way to do this but its what I've been given to work with at the moment.)

Now for the funny part. This select statement works fine if you simply run it in the command window. And the view works fine if you just open the view.

But, if you try using the view designer or if you query the view with the nodata clause, fox returns an (invalid group by clause) error.

So far as I can tell its a perfectly legal construction, and the sub-select works fine by itself. And as mentioned the syntax works "most of the time".

I tried moving the select into the from clause and doing a join on it, but got the same behavior. I tried similar constructions with different tables in the main and sub selects (just to test the limits of the problem) but got the same results all around.

Anyone seen this wierdness and managed to overcome it?
Sigfried Trent, aka FoxMan
(Working from his secret code cave, FoxMan battles the forces of darkness lead by the deranged and mysterious Bug Boy)
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform