Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can Subquery have GROUP BY?
Message
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01411733
Message ID:
01411763
Views:
33
An IN subquery must return only one field
select TABLE1.* FROM TABLE1 WHERE ID_FLD IN (
  select TABLE2.ID_FLD FROM TABLE2 WHERE ...) 
>
>I am getting error "invalid subquery" when using the following SQL Select:
>
>
>select TABLE1.* FROM TABLE1 WHERE ID_FLD IN (select TABLE2.ID_FLD, SUM(
> TABLE2.QUANTITY)  as USED_QUANTITY FROM TABLE2 GROUP BY TABLE2.ID_FLD) 
>
>
>The only thing that I see that could be causing this error is GROUP BY. Is this correct?
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform