Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Invalid subquery
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00484478
Message ID:
00484487
Vues:
13
Subquery here can contain only one field, like: ..where .. in (select dist comp_no from pctsum). I would do it in two steps:

select comp_no, sum(pct) as pctsum from ownpct group by comp_no having pctsum <> 100 into curs tmpcurs
select comp_no from ownpct where comp_no in (sele comp_no from tmpcurs)

Hope this'l help

>>>>>>>>>>>>>>>>your message below
Hi All,

I can't seem to get this to work, although the subquery performs if used by itself, is it due to the calculation occuring??


****this gets me an "subquery is invalid" error message
select ownpct.comp_no from ownpct where ownpct.comp_no in (select ownpct.comp_no, sum(ownpct.pct) as pctsum from ownpct group by comp_no having pctsum <> 100)
***end of select

I could run two selects but I though it'd be neater to get it done in one.

Please let me know if or what I'm doing wrong.

TIA

Jim Harvey
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform