Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Returning Values from Subquery 1

Status
Not open for further replies.

trbyrne

IS-IT--Management
Jul 5, 2007
60
US
Using Perv. SQL v8.6, I am trying to pull values from one table based on the query results from another table. I have tried the two SQL statements below but received errors (indicated for each statement).

SELECT * FROM "CUSTREL" where customernum in [select customernum from customer where accounttype='GLB']
>>>ERROR - invalid row count in subquery

SELECT * FROM "CUSTREL" where customernum in [select customernum from customer where accounttype='GLB']
>>>ERROR - where customernum in << ??? >>[select....
 
I'm not sure of V8 supports subqueries but you you might try:
SELECT * FROM "CUSTREL" where customernum in (select c.customernum from customer c where c.accounttype='GLB')

I used parenthesis instead of brackets and also added the table designation on the subquery.

Mirtheil
Certified Pervasive Developer
Certified Pervasive Technician
 
That did it! Thanks again Mirtheil for your valuable help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top